title: Prototype, array extension, and object property
body: <p>I m studying functionnal programming with Haskell, and I wanted now to use it with Javascript.</p>
  
  <p>I have read that it's a great training to reproduce some basic functions with javascripts, like map or filter, so I decided to make them, again.</p>
  
  <p>Actually I'have this code :</p>
  
  <pre><code>'use strict';
  
  
      Array.prototype.map = (cb) =&gt; {
        console.log(this); // get empty object
        console.log(this.length); // get undefined
      };
  
      let array = [1, 4, 9];
      array.map(Math.sqrt);
  </code></pre>
  
  <p>As you can see there, my problem is that I can't access the 'this' object in my map function, so I can't access my items inside of my prototypal function.</p>
  
  <p>How can I process to access each of the items in my array inside of my map function ?</p>
  
  <p>Thanks for your help.</p>