title: How to increment a value inside an object variable
body: <p>I have the following.</p>
  
  <pre><code>var dataset = {val1 : 0, val2 : 0, val3 : 0};
  var person = [];
  var totalPeople = 10;
  
  for(var i = 0; i &lt;totalPeople; i++) {
     person[i] = dataset; 
  }
  </code></pre>
  
  <p>Why i chose this approach, click <a href="https://stackoverflow.com/questions/25663030/jquery-array-object-how-to-add-suffix-variable-to-index-names">here
  .</a></p>
  
  <p>I'm trying to make one of the values auto increment inside another <code>for</code> loop.</p>
  
  <p>I've tried the following approaches to no avail.</p>
  
  <pre><code>person[1]{val1 : 0,
            val2 : 0,
            val3 : val3 + 1};
  
  person[1]{val1 : 0,
            val2 : 0,
            val3 : person[1].val3 + 1};
  
  person[1].val3 = person[1].val3 + 1;
  </code></pre>
  
  <p>any ideas?</p>