title: Cross-browser way to subclass JavaScript Array and get the array[i] method?
body: <p>Very glad to learn of <a href="https://stackoverflow.com/a/10763103/169992">this way</a> of basically subclassing a JavaScript <code>Array</code> (code copied from link):</p>
  
  <pre><code>function SomeType() {
      this.push(16);
  }
  
  SomeType.prototype = [];
  SomeType.prototype.constructor = SomeType; // Make sure there are no unexpected results
  
  console.log(new SomeType()); // Displays in console as [16]
  </code></pre>
  
  <p>But this isn't quite complete.  Is there a way to fake subclass the Array like this <em>and</em> get the <code>[]</code> method?</p>
  
  <pre><code>var a = [];
  a[3]  = true;
  console.log(a.length); //=&gt; 4
  
  var s = new SomeType();
  s[3]  = true;
  console.log(s.length); //=&gt; 1
  </code></pre>
  
  <p>This way you can still treat it as an array when doing a for loop:</p>
  
  <pre><code>for (var i = 0; i &lt; s.length; i++) {
    var item = s[i];
  }
  </code></pre>