I was dealing with a problem and got to the point where I thought I could use the Ids to my entity instances as array indices for easy lookup.
var myArray = [];
myArray[obj.Id] = true;
Assume obj.Id is 1000 here, so will be myArray.length. Am I allocating 1000 bytes for a single boolean value here or is it just returning the maximum index as length?