title: JavaScript toLowerCase() method returns an error in my react app
body: <p>I am trying to convert all characters in a search field to lower case in my react app using the <code>toLowerCase()</code> method but gives the error <code>typeError: Cannot read property 'toLowerCase' of undefined.</code></p>
  
  <pre class="lang-js prettyprint-override"><code>onSearchChange = (event) =&gt; {
    const filteredRobots = this.state.robots.filter(robot =&gt; {
      return robots.name.toLowerCase().includes(this.state.searchfield.toLowerCase());
    })
  </code></pre>