title: Using indexOf to filter an array
body: <p>I am trying to output the first two objects in the events array using indexOf. </p>
  
  <p>This doesn't return anything: </p>
  
  <pre><code>var whiteList=['css','js'];
  
  var events =[
      {file: 'css/style.css', type:'css'},
      {file: 'js/app.js', type:'js'},
      {file: 'index/html.html', type:'html'}
  ];
  
  var fileList= events
      .filter(function(event){
      return event.type.indexOf(whiteList) &gt;- 1 
    })
  
  console.log(fileList);
  </code></pre>
  
  <p>If I change the function like this, it returns the css and js object, although I expected it to return the html object. </p>
  
  <pre><code>var fileList= events
      .filter(function(event){
      return event.type.indexOf('html') 
    })
  </code></pre>