title: Java's arraylist to javascript's array not working
body: <p>Below is the code in my jsp file to convert Java's <code>ArrayList</code> to JavaScript's <code>Array</code>:</p>
  
  <pre><code>&lt;% for(int k=0;k&lt;listDate.size();k++){%&gt;
      var temp =&lt;%=listDate.get(k)%&gt;
      dates[&lt;%=k%&gt;] = temp;
  &lt;%}%&gt;
  document.write(dates[0]); // it prints out a totally unrelated value which I have no idea what it is "1974".
  </code></pre>