title: jquery .each loop on array with parseInt - gives NaN
body: <p>I have setup a loop using <code>.each</code> to get json encode string to an array to be used for jquery jqBarGraph </p>
  
  <p>The loop:</p>
  
  <pre><code>     $.each(dataarray, function (i, item) {
           JSarray[i] = [parseInt(item['count']),parseInt(item['year'])];                        
       });
  </code></pre>
  
  <p>The data in the dataarray contains a json string  = </p>
  
  <pre><code>    {"graph":{"count":"45","year":"2007"}}
  </code></pre>
  
  <p>after <code>.each</code> loop contains these values in the JSarray</p>
  
  <pre><code>    [45, 2007]
  </code></pre>
  
  <p>So a single string works, when i try to pass more data I get the vale NaN</p>
  
  <p>If I try to use this json encode string in the data dataarray the NaN comes</p>
  
  <pre><code>{"graph":[{"count":"45","year":"2007"},{"count":"390","year":"2008"}]}
  </code></pre>
  
  <p>My JSarray looks like this </p>
  
  <pre><code>[NaN, NaN]
  </code></pre>
  
  <p>What am I doing wrong?</p>