64
rated 0 times
[
66]
[
2]
/ answers: 1 / hits: 32039
/ 14 Years ago, thu, may 27, 2010, 12:00:00
I want to define an associative array like this
var theVar = [
{ 100, [0, 1, 2] },
{ 101, [3, 4, 5] }
]
Essentially I want to be able to access an array of three numbers by specifying the custom index.
However, no matter what I try I cannot make it work.
I know I can define it as:
theVar[100] = [0, 1, 2];
theVar[101] = [1, 2, 3];
But I am setting this somewhere else and I'd prefer to be able to set it in a single statement.
More From » web-applications