title: Error: "cannot read property "div" of undefined"
body: <p>I keep getting this error</p>
  <p>&quot;Cannot read property 'div' of undefined&quot;</p>
  <p>This is my Code</p>
  <pre><code>
  function checkCard(){
      for(let i = 0; i &lt; 13; i++){
          if(animalNums[i].animal.textContent === findArray[i].div.textContent){
              animalNums[i].animal.style.display = &quot;block&quot;
              animalNums[i].animal.classList.add(&quot;animate&quot;);
              setTimeout(function(){animalNums[i].animal.classList.remove(&quot;animate&quot;);},1001)
              score += 1
              document.getElementById(&quot;scoreP&quot;).innerHTML = `Score: ${score}` 
          }
      }
  }
  </code></pre>
  <p>Its saying findArray[i].div is undefined
  here is the array it is referencing :</p>
  <pre><code>let findArray = [ 
      {
         div: document.getElementById(&quot;findOne&quot;)
      },
      {
         div: document.getElementById(&quot;findTwo&quot;)
      },
      {
         div: document.getElementById(&quot;findThree&quot;)
      }
  ]
  
  </code></pre>
  <p>I'm not sure why this is happening as I believe I have done a very similar function that worked before. Is this something to do with Scope?</p>