let arr = [1,2,3,4,5];
Object.assign({}, [1,2,3,4,5]); // {0: 1, 1: 2, 2: 3, 3: 4, 4: 5}
Object.assign({}, ['a','b','c']); // {0: "a", 1: "b", 2: "c"}
{...[1,2,3,4,5]} // {0: 1, 1: 2, 2: 3, 3: 4, 4: 5}
Object.fromEntries(Object.entries([1,2,3,4])); // {0: 1, 1: 2, 2: 3, 3: 4, 4: 5}