title: How to create a datapoint object with a loop in JS?
body: <p>I would like to create this output in a JS while loop:</p>
  
  <pre><code>      dataPoints: [
      { x: 10, y: 10 },
      { x: 20, y: 11 },
      { x: 30, y: 14 },
      { x: 40, y: 16 },
      { x: 50, y: 19 },
      { x: 60, y: 15 },
      { x: 70, y: 12 },
      { x: 80, y: 10 }
    ]
  </code></pre>
  
  <p>When I put this</p>
  
  <pre><code>sdata[i] = accumulated;
  </code></pre>
  
  <p>Into my loop, it adds the entries like that:</p>
  
  <pre><code>Object {
  1: 1500, 
  2: 3005, 
  3: 4515.016666666666, 
  4: 6030.066722222222, 
  5: 7550.166944629629
  }
  </code></pre>
  
  <p>What do I have to put into the loop to create the output like at the beginning? </p>
  
  <p>Thanks for your help!</p>