Javascript array push subarray -


each newdata[x][0]] looks -> [95, 152, 174, 197, 261] when newgooddata.push([newdata[x][0]]) twice (x=0 , 1) newdata

i want be:

the structure want

i seem adding them wrong. , explanation?

you putting newdata[x][0] array before pushing.

newgooddata.push([newdata[x][0]])  // bad  newgooddata.push(newdata[x][0])    // 

the [] around newdata[x][0] creates new array containing 1 element: newdata[x][0].


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -