According to Airbnb Javascript Style Guide, a pair of parentheses should be added to wrap the braces. But why?
// good
[1, 2, 3].map((number, index) => ({
[index]: number,
}));
Is there anything wrong if I code without those parentheses? I mean just return the object is easier to read.
// anything wrong with this?
[1, 2, 3].map((number, index) => {
return {[index]: number};
});