I have an array that I want to transform into an object. For example:
const arr = [{id: 1, key: ''}, {id: 2, key: ''}];
I want the result to be:
const object = { 1: {id: 1, key: ''}, 2: { id: 2, key: ''}}
With lodash
I can use the keyBy
function, but I am working with ramda and did not find this functionality there.