Like to ask about the differences in ES6 in function syntax - with and without curly braces.
both functions are working:
function with a curly braces:
const function = () => {some code;};
same function without curly braces:
const function = () => some code;
Thanks.
welcome to Stackoverflow!
Indeed these functions without curly braces are a shorthand version that differs in some nuances.
the most important differences are:
() => 20 * 5
) Sticking to the example above, the more classic version to write this would be () => {return 20 * 5}
more details can be found here for example.