I have the following:
const a = (...args) =>{ return {...args}}
const abc = a('lol', 'rofl', 'lmao');
console.log('abc', abc);
However, this prints out
Object {0: "lol", 1: "rofl", 2: "lmao"}
But I expected
Object {lol: "lol", rofl: "rofl", lmao: "lmao"}
since
{lol, rofl, lmao}
produces the line above.
Is there a way to spread the arguments so that I can get this result?