title: Create object from array
body: <p>I want to create an object from a list inside an array. I have an array which is dynamic and supposed to look like this:</p>
  <p><code>var dynamicArray = [&quot;2007&quot;, &quot;2008&quot;, &quot;2009&quot;, &quot;2010&quot;];</code></p>
  <p>And I want to make an object like this with some JavaScript ES6:</p>
  <pre><code>const obj = {
      2007: {
          x: width / 5,
          y: height / 2
      },
      2008: {
          x: (2 / 5) * width,
          y: height / 2
      },
      2009: {
          x: (3 / 5) * width,
          y: height / 2
      },
      2010: {
          x: (4 / 5) * width,
          y: height / 2
      }
  }
  </code></pre>
  <p>Don't worry about the inner objects. I just want to create a structure like this:</p>
  <pre><code> obj = {
        2007: ...,
        2008: ...,
        ...
      }
  </code></pre>
  <p>Please help, thanks.</p>