Namely, how does the following code:
var sup = new Array(5);
sup[0] = \'z3ero\';
sup[1] = \'o3ne\';
sup[4] = \'f3our\';
document.write(sup.length + \"
A JavaScript array is an object just like any other object, but JavaScript gives it special syntax.
arr[5] = "yo"
The above is syntactic sugar for
arr.insert(5,"yo")
which is how you would add stuff to a regular object. It's what is inside the insert method that changes the value of arr.length
See my implementation of a customArray type here: http://jsfiddle.net/vfm3vkxy/4/