Familiarity Bias Is Holding You Back: It's Time to Embrace Arrow Functions
medium.com
medium.com
const secret = msg => () => msg;
This technically parses uniquely, but it's not at all obvious what the parse structure is. Writing it with the squiggly brackets makes it clearly parsable. const secret = { msg => { () => msg } };If you need to disambiguate associativity, you need to wrap with parentheses:
const secret = msg => ( () => msg );
But in this case, it's not required, because the alternative doesn't make sense: const secret = (msg => ()) => msg;
^ Unexpected token