Konwertuj tablicę obiektów na obiekty
//example array
const myArray = [
{ id: 1, name: "A" },
{ id: 2, name: "B" },
{ id: 3, name: "C" },
{ id: 4, name: "D" },
{ id: 5, name: "E" }
];
//converting array of objects to iterable objects
const obj = Object.assign({}, myArray);
//output
console.log(obj);
//output
/*
{0: {…}, 1: {…}, 2: {…}, 3: {…}, 4: {…}}
0: {id: 1, name: 'A'}
1: {id: 2, name: 'B'}
2: {id: 3, name: 'C'}
3: {id: 4, name: 'D'}
4: {id: 5, name: 'E'}
[[Prototype]]: Object
*/
Manaj Bera