title: Return value of each key in object in a for loop
body: <p>I have an object and an array:</p>
  
  <pre><code>m = { "1": ["2", "3"], "6": ["4", "5"] };
  var p = ["1", "6"];
  </code></pre>
  
  <p>I have a for loop:</p>
  
  <pre><code>for (var i = 0; i &lt; p.length; i++) {
      // Return an array that is the value of a key in m, for each key specified in p
      var array = m[p[i]]; 
  
      // do stuff with array
  }
  </code></pre>
  
  <p>Any reason why the above does not work? array is still <code>undefined</code> after the for loop runs.</p>