Is there a way to assign values in a JavaScript array in the way I do it in PHP.
For example in PHP I can do that:
$ar = array();
$ar[] = "Some value";
$ar[] = "Another value";
Is that posible to be done with JavaScript? Or if not is there any similar way ?
The direct translation of your original code is
However a better looking solution is to use the pretty universal
pushmethod: