In Javascript, know I can set an array so that the key is a autonumbered (starting at 0) assigned array:
var d_names = new Array("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");
// Key for Sunday is '0'
and if I want to assign keys, I could do:
var d_names={};
d_names[5]="Sunday";
d_names[6]="Monday";
d_names[7]="Tuesday";
d_names[8]="Wednesday";
d_names[9]="Thursday";
d_names[10]="Friday";
d_names[11]="Saturday";
// Key for Sunday is '5'
But is there a shorthand way to assign the keys like in PHP?
var d_names = new Array(5=>"Sunday", 6=>"Monday", 7=>"Tuesday", 8=>"Wednesday",
9=>"Thursday", 10=>"Friday", 11=>"Saturday");
// Doesn't work