title: TypeError: this.reduce is not a function
body: <p>After adding a method to the Array prototype, some other, unrelated script breaks.</p>
  
  <ul>
  <li>[Opera] Unhandled Error: 'this.reduce' is not a function</li>
  <li>[Firefox] TypeError: this.reduce is not a function</li>
  </ul>
  
  <p>The method itself works (<code>[1,2,3].xintsum()</code> outputs <code>6</code> as expected).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// adding a function to the Array prototype
  Array.prototype.xintsum = function() { return this.reduce(function(old, add) {return old + add;}, 0); };
  
  // accessing the array in a way that worked before
  $(document).ready(function (){
    var some_array = [];
    for (head_n in some_array) {
      var v = some_array[head_n];
      $('&lt;th&gt;&lt;/th&gt;').text(v);
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>