Hi guys,
I’ve just finished lesson “Write Concise Object Literal Declarations Using Object Property Shorthand” and in the explanation and example by fCC, I don’t understand one thing.
Why there are normal parentheses around the object, and not the curly brackets as with any other function declaration?
fCC example:
ES5:
const getMousePosition = (x, y) => ({
x: x,
y: y
});
ES6:
const getMousePosition = (x, y) => ({ x, y });
Thank you!
Challenge: Write Concise Object Literal Declarations Using Object Property Shorthand
Link to the challenge: