title: Accessing arrays in JSON
body: <p>I feel like this question has to have been asked but for the life of me I cannot find it. I have an array of objects for football play by play data. The array is actually one of objects. Each object encapsulates all data that happens during any given play in a football game. Here is my JSON object:</p>
  
  <pre>
      var playsToAdd = {
      "play":
      [
       {"quarter":""},
       {"drive":""},
       {"down":""},
       {"fieldPos":""},
       {"yardsToGo":""},
       {"yardsGained":""},
       {"playType":""},
       {"playResult":""},
       {"ballSide":""},
       {"oForm":""},
       {"dForm":""},
       {"scoreFSU":""},
       {"scoreOp":""},
       {"playSide":""},
       {"addToDB":""},
       {"players":
        [
         {"name":""},
         {"position":""}
        ]
       }
      ]
     };
  </pre>
  
  <p>Here is where I try to add data to the object </p>
  
  <pre><code>for(l=0;l&lt;plays.length;l++)
     {
      playsToAdd.play[l].quarter=plays[l].quarter;
      playsToAdd.play[l].drive=plays[l].drive;
      playsToAdd.play[l].down=plays[l].down;
      playsToAdd.play[l].fieldPos=plays[l].fieldPos;
      playsToAdd.play[l].yardsToGo=plays[l].yardsToGo;
      playsToAdd.play[l].yardsGained=plays[l].yardsGained;
      playsToAdd.play[l].playType=plays[l].playType;
      playsToAdd.play[l].playResult=plays[l].playResult;
      playsToAdd.play[l].ballSide=plays[l].ballSide;
      playsToAdd.play[l].oForm=plays[l].oForm;
      playsToAdd.play[l].dForm=plays[l].dForm;
      playsToAdd.play[l].scoreFSU=plays[l].scoreFSU;
      playsToAdd.play[l].scoreOp=plays[l].scoreOp;
      playsToAdd.play[l].playSide=plays[l].playSide;
      playsToAdd.play[l].addToDB=plays[l].addToDB;
      for(m=0;m&lt;plays[l].players.length;m++)
      {
       //playsToAdd[l].players[m].position=plays[l].players[m][1];
       //playsToAdd[l].players[m].name=plays[l].players[m][0];
       playsToAdd.play[l].players[m].name="test";
      }
     }
  </code></pre>
  
  <p>Everything seems to work out fine until I get to the players piece. I actually commented out my object to make sure that wasn't the problem. I get an error <code>Unable to get value of the property '0': object is null or undefined</code> in regards to <code>playsToAdd.play[l].players[m].name="test";</code>. I've looked around this site and others but haven't found anything that speaks to my issue. Any help is greatly appreciated</p>