title: Check if an array contains something other than null in javascript?
body: <p>I have an array that will most likely always look like: </p>
  
  <pre><code>[null, null, null, null, null]
  </code></pre>
  
  <p>sometimes this array might change to something like: </p>
  
  <pre><code>["helloworld", null, null, null, null]
  </code></pre>
  
  <p>I know I could use a for loop for this but is there a way to use <code>indexOf</code> to check if something in an array that is not equal to null. </p>
  
  <p>I am looking for something like: </p>
  
  <pre><code>var index = indexof(!null);
  </code></pre>