Array of object : value as key of the array? : <p>I have an array of objects as below;</p>

<pre><code>{
    'data': [{
            value: 1000,
            year: 1990
        },
        {
            value: 1001,
            year: 1990
        },
        {
            value: 1002,
            year: 1990
        },
        {
            value: 1003,
            year: 1991
        },
        {
            value: 1004,
            year: 1991
        }
    ]
}
</code></pre>

<p>I want to convert the same to the one looks like below object</p>

<pre><code>{
    '1990': [{
            value: 1000,
            year: 1990
        },
        {
            value: 1001,
            year: 1990
        },
        {
            value: 1002,
            year: 1990
        }],

    '1991':[{
            value: 1003,
            year: 1991
        },
        {
            value: 1004,
            year: 1991
        }
    ]
}
</code></pre>

<p>Is there any way for doing the same in Javascript or Angular 4?</p>
