i am new of javascript, i have been told by someone, he said “speak strictly, javascript doesn’t have multidimensional Array and associative array “. but in a book, i saw the following
var my_cars=Array();
my_cars["cool"]="Mustang";
$a=Array(Array(0,1),2);
so the opinion form he is wrong? am i right?
JavaScript has arrays of whom their elements can be other arrays.
However, JavaScript has
Objects with properties, not associative arrays.Buy a better book.
[]is much better thanArray(). Also, why not instantiate anArrayobject explicitly then rely onArrayreturning a new object?coolon theArray.$asigil? Why nonewoperator again?