js 循环遍历数组

var siteInfoData = res.data.data.siteInfoList;
              var siteInfoList = [];
              console.log(siteInfoData)
              for (var i = 0; i < siteInfoData.length; i++ ){
                var str = siteInfoData[i];
                siteInfoList.push({ latitude: str.latitude, longitude: str.longitude});
               
              }
              console.log(siteInfoList);

 

posted @ 2018-09-14 11:58  知兮  阅读(320)  评论(0编辑  收藏  举报