3 ms·
Familiarity Bias Is Holding You Back: It's Time to Embrace Arrow Functions
- Safety1stClyde 9y agoThe interesting bit seems to be the "premium content".
- powera 9y agoThis guy is incredibly sanctimonious, but he misses the biggest problem with his notation. Not all the operators he uses are associative. 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 } };
- ericelliott 9y agoI'm not sure what you're trying to express. The "squiggly brackets" example is not valid JavaScript. 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