title: I need to create a Javascript Function to create custom push function
body: <p>I am building JavaScript code to make a custom push function. My new function should act exactly like the original push function. </p>
  
  <p>Here is the code. Please check it. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function MyArray(){
      this.add=function(x){
  
          return this[this.length]=x;
      }
  }
  
  MyArray.prototype=Array.prototype;
  
  var collection = new MyArray();
  
  
  collection.push(44);
  
  collection.add(56); // this is not working. 
  
  collection.push(77);
  collection.push(88);
  
  console.log(collection);
  
  &lt;/script&gt;
  </code></pre>