Shorter syntax for arrow function assignment

T.J. Crowder tj.crowder at
Wed Oct 25 14:20:42 UTC 2017

On Wed, Oct 25, 2017 at 3:11 PM, J Decker <d3ck0r at> wrote:
> ya this is not a syntax error.
> myFn()
> {
> }

Indeed it isn't, but that isn't what I referred to in dante's message,
nor is it what he was suggesting it would be. He quoted

myFn() {

...which is indeed a syntax error because ASI doesn't kick in. This:


...isn't a syntax error because ASI adds a `;` after `myFn()`, making
it a function *call* followed by a standalone block, not the function
declaration/expression he suggested it was.

All of which is by-the-bye, though, as I don't think Brian was
suggesting that anyway... :-)

-- T.J. Crowder

More information about the es-discuss mailing list