title: Why checking null in Array.prototype.forEach()?
body: <p>In the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Polyfill" rel="nofollow">MDN polyfill</a> for Array.prototype.forEach()</p>
  
  <pre><code>// Production steps of ECMA-262, Edition 5, 15.4.4.18
  // Reference: http://es5.github.io/#x15.4.4.18
  if (!Array.prototype.forEach) {
  
    Array.prototype.forEach = function(callback, thisArg) {
  
      var T, k;
  
      if (this == null) {
        throw new TypeError(' this is null or not defined');
      }
  
      // 1. Let O be the result of calling toObject() passing the
      // |this| value as the argument.
      var O = Object(this);
  
      // 2. Let lenValue be the result of calling the Get() internal
      // method of O with the argument "length".
      // 3. Let len be toUint32(lenValue).
      var len = O.length &gt;&gt;&gt; 0;
  </code></pre>
  
  <p>I can't imagine a situation that <code>this == null</code> will happen. Can you give me an example? Thanks.</p>