// Sub classing array works as expected. Many people have false expectation that // special behavior of number properties (sub[10]) is supposed to be inherited by a subclass. function SubArray() { var subArray = Object.create(SubArray.prototype) Array.prototype.push.apply(subArray, arguments) return subArray } SubArray.prototype = Object.create(Array.prototype, { constructor: { value: SubArray } , last: { value: function last() { return this[this.length - 1] }} })