Ok, the reason you're confused is because that guy isn't actually using an Array there (at least not a numerically indexed one). The reason his code works is because of the fact that an Array is-an Object in JavaScript, and he's assigning
properties to the object, not numerical indexes to an Array.
Now, properties of objects can be set using two operators: the dot operator, or the subscript operator (square brackets). The following are equivalent:
Code:
var myObj = new Object();
myObj.property = "value";
// ...
var myObj = new Object();
myObj[ 'property' ] = "value";
// ...
var myObj = new Object();
var propName = 'property';
myObj[ propName ] = "value";
So like I said, an Array in JavaScript is-an Object, because it extends Object (just like everything else in JavaScript).
Code:
var myArr = new Array();
alert( myArr instanceof Object ); // alerts "true"
And since all objects in JavaScript can have properties, that is why that guy's code works when he assigns the string ID's to the "array". You'll actually notice that if you take his code, and set
tabLinks to be just a Object instead of an Array, the code works just the same.
Code:
var tabLinks = new Object();