title: Javascript: pushing certain info to Array and getting info out of array
body: <p>I have a question about the following problem:</p>
  
  <p>I made a board for a game made out of pieces. Each piece has its own x and y coordinates, but also a boolean wether it's a road or not and wether it has a turret on or not.</p>
  
  <p>So this is the Array: </p>
  
  <pre><code>var Array = [""];            
  Array.push({
            x: i, 
            y: j,
            road: false,
            tower: null,
            id: "gamezone"+j+i
          });
  </code></pre>
  
  <p>Now, the Array.push is found in a loop which gives the information: that part works. Now for the question:</p>
  
  <p>How do I edit certain information of each object of the array?
  For instance, certain pieces do have a road on, so what I did was:</p>
  
  <pre><code>Array.push({road: true});
  </code></pre>
  
  <p>but that didn't do it.
  How would I do that?</p>
  
  <p>Second question:
  If I want to use some information of objects of the array, for example I have to make an if-else with <code>if (Array(road = true)) then ...</code>
  I don't think that's a correct way to get info out of the array, so please help me there.</p>
  
  <p>If you've any documentation on doing this, mind giving a link as well?</p>
  
  <p>Thanks a bunch!</p>