title: In Javascript, how do I use .filter to return objects that have a property that contains a string?
body: <p>I have the following code that returns everything I expect it to</p>
  
  <pre><code>let discs = Discrepancies.filter(function(disc) {
    return disc.defect.toLowerCase() == def.id.toLowerCase();   
  });
  </code></pre>
  
  <p>however, now I would like to change this to return all results that contain a substring. For example:</p>
  
  <pre><code>disc.defect.toLowerCase = 'loose fastener'
  </code></pre>
  
  <p>and I want to return all <code>def.id.toLowerCase()</code> if it contains the substring <code>'loose'</code>.</p>
  
  <p>How do I accomplish this?</p>
  
  <p>I tried <code>include</code> but it doesn't seem to work for me. I'm using IE 11.</p>