Push multi values in javascript array and get the first element?
Below, I am trying to push 3 different values in a array:
var a = [];
a.push([1, 'b', 'c']);
DBG.write("test:" + a[0]); //output: 1, b, c
how to print the the first element on this array?
output should be: 1
a[0][0]asa[0]is an array!Array.pushexpects direct values, and not an array.a.push([1, 'b', 'c'])is pushing an array to the first element ofa.undefinedas well..a.push(1,2,3)is different thana.push([1,2,3])