title: Array.prototype.reject(): TypeError: ....reject is not a function
body: <p>I am taking a cool online course about functional programming in JavaScript. I was following along just fine until the instructor used the <code>Array.prototype.reject()</code> and it did not work for me at run time.</p>
  
  <p>I would like to use "reject" instead of a for loop because it is less code. But, my browser, NodeJS and Express Code consoles tell me that <code>reject is not a function</code>.</p>
  
  <p>I researched other articles that discuss <code>promise.reject</code> is not a function, but provide solutions that do not make sense to my scenario. </p>
  
  <p>Here is the example code in the course:</p>
  
  <pre><code>var animals = [
      { name: 'Fluffykins',   species: 'rabbit' },
      { name: 'Caro',         species: 'dog' },
      { name: 'Hamilton',     species: 'dog' },
      { name: 'Harold',       species: 'fish' },
      { name: 'Ursula',       species: 'cat' },
      { name: 'Jimmy',        species: 'fish' }
  ];
  
  
  var isDog = function(animal){
      return animal.species === 'dog';
  }
  
  var otherAnimals = animals.reject(isDog);
  </code></pre>
  
  <p>The work-around with a for-loop:</p>
  
  <pre><code>var notDogs = animals.filter(function(animal){
      return animal.species !== 'dog';
  });
  </code></pre>
  
  <p>Its output is:</p>
  
  <pre><code>&gt; notDogs
  [ { name: 'Fluffykins', species: 'rabbit' },
    { name: 'Harold', species: 'fish' },
    { name: 'Ursula', species: 'cat' },
    { name: 'Jimmy', species: 'fish' } ]
  </code></pre>
  
  <p>Please help me use <a href="https://github.com/thejameskyle/Array.prototype.reject" rel="noreferrer">Array.prototype.reject()</a>.</p>
  
  <p>EditL</p>
  
  <p>I found Array.prototype.reject() at <a href="https://github.com/thejameskyle" rel="noreferrer">GitHub</a>/Array.prototype.reject)</p>