title: Uncaught TypeError: Cannot read property 'add' of undefined
body: <p>I have the following code written in my <code>.js</code> file:</p>
  
  <pre><code>var tiles = document.querySelectorAll(".tile");
  var tileNumbers = ["one", "two", "three", "four"];
  
  for(var i = 0; i &lt; tiles.length; i++){
      var num = Math.floor(Math.random() * tileNumbers.lenth);
      tiles.classList.add(tileNumbers[num]);
      tileNumbers.pop(num);
  }
  </code></pre>
  
  <p>The <code>.tile</code> are 4 <code>&lt;div&gt;</code>'s in the .html file, and I am trying to add a class each of the four tiles separately. The classes are held in <code>tileNumbers</code>. When I run the code in Chrome I get the error:</p>
  
  <blockquote>
    <p>"Uncaught TypeError: Cannot read property 'add' of undefined."</p>
  </blockquote>
  
  <p>I am pretty sure everything is spelled correctly. Please help!</p>