title: What is causing this issue with my array...?
body: <p>I am making a game for my computing class and the objective of the game is for the player to move around the grid and collect all of the passengers in the game and deliver them to the base before they run out of power. I have managed almost everything else except for when I try to check whether the player moves over a passenger. My latest fiddle: <a href="http://jsfiddle.net/nZ8vA/13/" rel="nofollow">http://jsfiddle.net/nZ8vA/13/</a> is as far as I have tried in getting it to detect the passengers. In the fiddle it seems as if it is working (as it detects the p) however if you continue to move around the grid and then go back it will detect other random squares as being passengers even though they do not have a letter assigned to them. </p>
  
  <p>My new array (that I am struggling to figure out how to get to work properly):</p>
  
  <pre><code>var map = [
      [{ color: "g", letter: "" }, 
       { color: "g", letter: "" }, 
       { color: "w", letter: "P" }, 
       { color: "w", letter: ""  }],
  
      [{ color: "w", letter: "" }],
  
      [{ color: "w", letter: "" }],
  
      [{ color: "g", letter: "" }, 
       { color: "g", letter: "" }, 
       { color: "w", letter: "" }, 
       { color: "w", letter: "" }],
  
      [{ color: "g", letter: "" }, 
       { color: "b", letter: "" }, 
       { color: "b", letter: "" }, 
       { color: "w", letter: "" }, 
       { color: "w", letter: "" }, 
       { color: "w", letter: "" }, 
       { color: "g", letter: "" }, 
       { color: "g", letter: "" }, 
       { color: "w", letter: "" }, 
       { color: "w", letter: "" }]
  ];
  </code></pre>
  
  <p>I am really struggling in trying to get this to work, if anyone knows why this is not working then that would be great.</p>
  
  <p>My old fiddle (before I started attempting to detect the passengers) contains the old array I had, and the full grid layout: <a href="http://jsfiddle.net/nZ8vA/7/" rel="nofollow">http://jsfiddle.net/nZ8vA/7/</a></p>