On Tue, Oct 24, 2017 at 6:26 PM, dante federici
<[email protected]> wrote:
>
> So, something like:
> ```
> myFn() {
> }
> ```
>
> Would be considered as:
> ```
> var myFn = function() {
> }
> ```
>
> with what semantics exist now. Not best practices, but what is
> currently interpreted in the language.

No, it isn't. It's a `SyntaxError: Unexpected token {`. There's a big
difference between `myFn() { }` and `myFn = function() { };` The latter is
valid syntax for the horror of implicit globals (in loose mode; strict mode
fixed it). The former is just a syntax error. (It would be valid method
syntax if it were inside an object initializer or `class`.)

But AFAIK, Brian Blakely wasn't promoting that syntax anyway. His original
post only ever uses this shorthand with `export`, so I think it was meant
to be specific to exporting.

-- T.J. Crowder
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to