Reputation: 49391
Each newdata[x][0]]
looks like this -> [95, 152, 174, 197, 261]
but when I do newgooddata.push([newdata[x][0]])
twice (x=0 and 1)
I get
I want it to be:
I seem to be adding them wrong. Some help , with an explanation?
Upvotes: 3
Views: 10617
Reputation: 1088
You are putting newdata[x][0]
into an array before pushing.
newgooddata.push([newdata[x][0]]) // bad
newgooddata.push(newdata[x][0]) // good
The extra []
around newdata[x][0]
creates a new array containing one element: newdata[x][0]
.
Upvotes: 5