+ 2
What is your favorite way to write arrays?
3 Answers
+ 1
var array = ["1", "2"];
0
As a side note:
JavaScript does not support associative arrays.
You should use objects when you want the element names to be strings (text) and
use arrays when you want the element names to be numbers.
Var
0
classic way in javascript and push method in php