How to map a collection (array of objects) to object with key and value from the collection objects members? The collection is:
const collection = [{
id: 1,
url: 'http://url1.com'
}, {
id: 2,
url: 'http://url2.com'
}, {
id: 3,
url: 'http://url3.com'
}];
The result should be:
{
1: 'http://url1.com',
2: 'http://url2.com',
3: 'http://url3.com'
}
Would be better to use lodash for this