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);