Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

push data into an array with pair values

how can I push data into an array in js if it's type is likw this... d= [[label, value]]. At first I want to push the label data then the values.... I get the data from an xml file. If I had only a simple array I used the simple variable.push sintax. Will varialble[][0].push or variable[][1].push work

like image 762
Andrei Ion Avatar asked Aug 02 '12 07:08

Andrei Ion


1 Answers

You could do like this:

var d = [];
d.push([label, value]);
like image 110
xdazz Avatar answered Sep 22 '22 12:09

xdazz