Create object from array : <p>I want to create object from list of array. I have an array which is dynamic which suppose to be look like this:</p>

<p><code>var dynamicArray = ["2007", "2008", "2009", "2010"];</code></p>

<p>and with some javascript es6 I want to make an object like this:</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 inner objects but just wanted to a make structure like this:</p>

<pre><code> obj = {
      2007: ...,
      2008: ...,
      ...
    }
</code></pre>

<p>Please help, Thanks.</p>
