Похожие чаты

Guys if I have an array like: let arr = [{id:

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?

1 ответов

15 просмотров

reduce it

Похожие вопросы

Карта сайта