title: indexOf() function not working on arrays
body: <p>I have two divs as shown below:</p>
  
  <pre><code>&lt;div class="container"&gt;&lt;/div&gt;
  &lt;div class="container"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I created an array using these two divs:</p>
  
  <pre><code>var containers = document.querySelectorAll(".container");
  </code></pre>
  
  <p>I also created a variable to represent the first div:</p>
  
  <pre><code>var div1 = document.querySelectorAll(".container")[0];
  </code></pre>
  
  <p>When I use <code>indexOf()</code> to get the index of the first div in the array, I get an error: </p>
  
  <blockquote>
    <p>containers.indexOf is not a function</p>
  </blockquote>
  
  <p>Here is a snippet summarizing my problem:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var containers = document.querySelectorAll(".container");
  var div1 = document.querySelectorAll(".container")[0];
  containers.indexOf(div1); // returns the error</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;&lt;/div&gt;
  &lt;div class="container"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>