将对象转换为数组

拿到[{时间:数值},{时间:数值},....]这样的数组,提取出其中的时间和数值:

for (let key in curentData){
arrTime.push(key);
arrValue.push(curentData[key]);
}

for(i=1;i<=arrValue.length;i++){
curentValue.push([arrTime[i],arrValue[i]]);
}

猜你喜欢

转载自www.cnblogs.com/spiral-up/p/11914670.html