1, name: "John", surname: "Doe"}, {id: 2, name: "Jane", surname: "Doe"}, ...]
can I convert this array in-loco into an object like:
{1: {name: "John", surname: "Doe"}, 2: {name: "Jane", surname: "Doe"}}
or do I need to create a new object and replace the value of arr entirely?
reduce it
Обсуждают сегодня