title: Uncaught TypeError: Cannot read property 'filter' of undefined in crud script
body: <p>I don't know where my issue is on this. Any assistance is greatly appreciated.</p>
  <p>function search(){</p>
  <pre><code>    var searchInput = document.getElementById(&quot;searchInput&quot;).value;
      var resultsArray = data.filter(function(r){
        return r[1].indexOf(searchInput) !== -1;
      });
      var searchResultsBox = document.getElementById(&quot;searchResults&quot;);
      var templateBox = document.getElementById(&quot;rowTemplate&quot;);
      var template = templateBox.content;
  
      searchResultsBox.innerHTML = &quot;&quot;;
  
      resultsArray.forEach(function(r){
  
        var tr = template.cloneNode(true);
        var eeIdColumn = tr.querySelector(&quot;.nameId&quot;);
        var firstNameColumn = tr.querySelector(&quot;.firstName&quot;);
        var lastNameColumn = tr.querySelector(&quot;.lastName&quot;);
        eeIdColumn.textContent = r[0];
        firstNameColumn.textContent = r[1];
        lastNameColumn.textContent = r[2];
        searchResultsBox.appendChild(tr);
      
      });
  </code></pre>