我试图将一个数组的内容推送到另一个数组中,但是当我控制台记录新数组时,我在新数组中获取了旧数组的内容,并附加了 NaN。
我尝试使用 [] 和 new Array() 声明我的数组,但我仍然得到相同的输出
this.active_bid = data[0].active_bids; //Length of 3
var timer_act = new Array(this.active_bid.length)
for(var i=0; i< this.active_bid.length; i++){
timer_act[i] = (Number(this.active_bid[i].time_left));
}
console.log(timer_act)
产出
[0,0,0, NaN]
前三个零是有效的,但我不明白为什么我得到 NaN
相关分类