title: Why passing function reference is failing while using function declaration is not?
body: <p>Following code fails:</p>
  
  <pre class="lang-js prettyprint-override"><code>array.map(String.prototype.toLowerCase)
  </code></pre>
  
  <p>Throws <code>Uncaught TypeError: String.prototype.toLowerCase called on null or undefined</code>. Indeed, <code>this</code> is not set, I got it.</p>
  
  <p>But what's weird is that following code returns an array of empty strings without failing:</p>
  
  <pre class="lang-js prettyprint-override"><code>array.map((s) =&gt; String.prototype.toLowerCase(s))
  </code></pre>
  
  <p>Any idea why? <strong>Note that I know this is not the way of having an array of lowercased strings.</strong> I'm just wondering why these two approaches behave differently.</p>
  
  <p>In other words, what is the difference between <code>.map(String.prototype.toLowerCase)</code> and <code>.map((s) =&gt; String.prototype.toLowerCase(s))</code>? I thought is was identical, but obviously, it behaves differently. Note that here, <code>String.prototype.toLowerCase</code> could be replaced by anything.</p>