title: Populating another array from array - Javascript
body: <p>Very simple thing I am trying to do in JS (assign the values of one array to another), but somehow the array <code>bar</code>'s value doesn't seem affected at all. </p>
  
  <p>The first thing I tried, of course, was simply <code>bar = ar;</code> -- didn't work, so I tried manually looping through... still doesn't work.</p>
  
  <p>I don't grok the quirks of Javascript! Please help!!</p>
  
  <pre>
  <code>
  var ar=["apple","banana","canaple"];
  var bar;
  </code>
  </pre>
  
  <pre>
  for(i=0;i&lt;ar.length;i++){
      bar[i]=ar[i];
  }
  alert(ar[1]);
  
  </pre>
  
  <p>And, here is the fiddle: <a href="http://jsfiddle.net/vGycZ/" rel="noreferrer">http://jsfiddle.net/vGycZ/</a></p>
  
  <hr>
  
  <p>(The above is a simplification. The actual array is multidimensional.)</p>