title: Changing properties of a Javascript object from string to int
body: <p>I have an array of objects with three properties each (year, total, per_capita).
  Example:</p>
  
  <pre><code>0: Object
    per_capita: "125.8"
    total: "1007.2"
    year: "2009"
  </code></pre>
  
  <p>Those properties are strings and I want to create a loop that goes through the array and converts them to int.
  I tried the following loop:</p>
  
  <pre><code>for (i=0; i&lt;data.length; i++){
      parseInt(data[i].year, 10)
      parseInt(data[i].total, 10)
      parseInt(data[i].per_capita, 10)
  }
  </code></pre>
  
  <p>However when I do typeof(data[0].total) it says its a string.
  I am having problems later in the program and I think it is because the values cannot be computed properly because they are not the right type.
  Anyone have an idea where the problem is?</p>