title: Is there a functional way to init an array in JavaScript ES6?
body: <p>I finally gave up and wrote a <code>for</code> loop to initialize a simple array of objects where each object has an incremented counter (<code>id</code>) as an attribute of the object. In other words, I just want:</p>
  
  <pre><code>var sampleData = [{id: 1},{id: 2},...];
  </code></pre>
  
  <p>I was hoping for a compact syntax I could just put on my return statement.</p>
  
  <pre><code>let sampleData = [];
  for (var p = 0; p &lt; 25; p++){
      sampleData.push({id: p});
  }
  
  return {
      data: sampleData,
      isLoading: true
  };
  </code></pre>