title: Cannot read property 'Symbol(Symbol.iterator)' of undefined
body: <p>I'm trying to loop through an array to check if it contains any item that passes a specified function. I do this by adding a .any() prototype to the Array object:</p>
  
  <pre><code>Array.prototype.any = (comparator) =&gt; {
      for(let item of this){
          if(comparator(item)){
              return true;
          }
      }
      return false;
  };
  </code></pre>
  
  <p>Then calling Array.any() like:</p>
  
  <pre><code>else if(users &amp;&amp; users.any((user) =&gt; user.userName === user.userName)){
          res.status(400).send('Username already in use');
  }
  </code></pre>
  
  <p>This however gives me the following error:</p>
  
  <pre><code>TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  at Array.any (C:\dev\nodejs\testproject\dist\routes\userRoutes.js:29:39)
  at C:\dev\nodejs\testproject\dist\routes\userRoutes.js:87:56
  at Query.&lt;anonymous&gt; (C:\dev\nodejs\testproject\node_modules\mongoose\lib\model.js:3748:16)
  at C:\dev\nodejs\testproject\node_modules\kareem\index.js:277:21
  at C:\dev\nodejs\testproject\node_modules\kareem\index.js:131:16
  at _combinedTickCallback (internal/process/next_tick.js:67:7)
  at process._tickCallback (internal/process/next_tick.js:98:9)
  </code></pre>
  
  <p>The error seems to me like it is suggesting 'this' in the prototype function is undefined, but 'this' is the users array for which i checked for undefined.</p>
  
  <p>Not realy sure what is actually causing the issue, hope you can help.</p>