将对象转换为数组

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

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

posted @ 2019-11-22 22:38  btf-day  阅读(144)  评论(0)    收藏  举报