title: How to solve TypeError: Cannot read property 'filter' of undefined error after replacing lodash find function with native JS filter function?
body: <p>I'm trying to remove lodash find function, so my change is basically replacing this line:</p>
  
  <pre class="lang-js prettyprint-override"><code>const current = find(items, elem =&gt; elem.id === item.id);
  </code></pre>
  
  <p>with this one:</p>
  
  <pre class="lang-js prettyprint-override"><code>const current = items ? items.filter(function(x) {
    return x.id === item.id;
  }) : null;
  </code></pre>
  
  <p>But I'm getting this error:</p>
  
  <blockquote>
    <p>app.js:659 Uncaught (in promise) TypeError: Cannot read property 'filter' of undefined</p>
  </blockquote>