In PHP its possible to do the following:
$array[] = 1;
$array[] = 2;
And on its own, you will end up with:
$array[0] === 1;
$array[1] === 2;
With JS however, this isn't so simple. At least from my understanding.
It seems you need to firstly start the array
var array = new Array();
Then:
array[0] = 1;
array[1] = 2;
Due to my php (and quite inferior) background, the way I've constructed my JS function I can only see it working if I can set array variables in a similar way to its possible in php.
Is it possible to achieve this same functionality? If so, how?