title: How to define method in javascript on Array.prototype and Object.prototype so that it doesn't appear in for in loop
body: <p>I want to define helper methods on the Array.prototype and Object.prototype. My current plan is to do something like:</p>
  
  <pre><code>Array.prototype.find = function(testFun) {
     // code to find element in array
  };
  </code></pre>
  
  <p>So that I can do this:</p>
  
  <pre><code>var arr = [1, 2, 3];
  var found = arr.find(function(el) { return el &gt; 2; });
  </code></pre>
  
  <p>It works fine but if I loop over the array in a <code>for in</code> loop the methods appear as values:</p>
  
  <pre><code>for (var prop in arr) { console.log(prop); }
  // prints out:
  // 1
  // 2
  // 3
  // find
  </code></pre>
  
  <p>This will screw up anybody else relying on the <code>for in</code> to just show values (especially on Objects). The later versions of javascript have .map and .filter functions built into arrays but those don't show up on <code>for in</code> loops. How can I create more methods like that which won't show up in a <code>for in</code> loop?</p>