title: Custom array Function using prototype. new MyArray(1,2,3,4) not working
body: <p>All I need is a custom function to act as an native Array object. When I create an object it should act like same as the <code>new Array(1,2,3,4)</code>. It should create an array of elements.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function MyArray(){
  
  }
  
  MyArray.prototype=Array.prototype;
  
  var collection = new MyArray(1, 2, 3, 4);
  
  
  console.log(collection);
  
  
  // My code should act like. 
  
  var coll= new Array(1,2,3,4);
  
  console.log(coll);
  
  &lt;/script&gt;
  </code></pre>