I need to convert an array of objects into an object of objects properties from the array.
Here is an example of an array of objects
array of objects
co
You could spread the array as parameters (spread syntax ...) for Object.assign, which returns a single object.
const array = [{ book: 5, car: 6, pc: 7 }, { headphone: 9, keyboard: 10 }], object = Object.assign({}, ...array); console.log(object);