title: Why am I receiving a TypeError of Cannot read property 'move' of undefined for an array and object I have defined?
body: <p>Receiving TypeError: Cannot read property 'move' of undefined
      at fitnessTest.</p>
  
  <pre><code>function fitnessTest(arrayObject){
    let turnsArray = [];
    for (i = 0; i &lt;= arrayObject.length; i++){
      let steps = 0;
      let turns = 0;
      while (steps &lt;= 20){
        steps += arrayObject[i].move();
        turns++;
      } turnsArray.push(`${arrayObject[i].name} took ${turns} turns to take 20 steps.` );
    }      return turnsArray;
  }
  </code></pre>
  
  <p>the .move property is defined inside an object as</p>
  
  <pre><code>    move: function(){
        return Math.round(Math.random()*10);
  </code></pre>
  
  <p>and that object is placed inside of an array passed to the fitnessTest function</p>