Problem Statement
I have an array.
['a', 'b', 'c']
How do I convert it into the following by JavaScript?
{
0: 'a',
1: 'b',
2: 'c'
}
Solution
This should do it.
Object.assign({}, ['a', 'b', 'c']);
or
{...['a', 'b', 'c']}