title: D3.js ~ How to filter data values containing certain values/words?
body: <p>filtering data for a visualization I noticed that some values that do not correspond exactly to the values contained in the filter are not passed.
  what I would like to do is to filter all the values in my dataset that contain that word, now i have:</p>
  
  <pre><code>stile.filter(function (d) { return d.StyleName == "Bold" || d.StyleName == "Demi" || d.StyleName == "Semibold"; });
  </code></pre>
  
  <p>I thought that adding the <code>.contains()</code> at the end of each value I want filtered could do the trick, like so:</p>
  
  <pre><code>stile.filter(function (d) { return d.StyleName.contains("Black") || d.StyleName.contains("Heavy") || d.StyleName.contains("Extrabold") || d.StyleName.contains("BoldNonextended"); })
  </code></pre>
  
  <p>But this didn't work unfortunately. Any help as always is really appreciated, thanks!</p>
  
  <p><strong>EDIT</strong>: my dataset is a csv, the StyleName column has vairous values, like:
  <code>Bold, Bold Extended, Regular</code> and so on. If I use the filter function that I have now, the data row containing <code>Bold Extendend</code> for example, is not returned because it has the word <code>Extended</code> also in it. That's what I'm trying to solve</p>