News for hackers. Stuff that matters.
Re:ECMAScript 2018: final feature set by rmrfrmrf on Saturday February 03, 2018 @09:30AM (#16297741)
> E.g. JS has now two different ways to write functions, with slightly different semantics.

Just 2? More like 9:

* function expression

* function declaration

* arrow function (single line, single param)

* arrow function (single line, multiparam)

* arrow function (multiline, single param)

* arrow function (multiline, multiparam)

* object shorthand

* class declaration

* class expression

Re:ECMAScript 2018: final feature set by Veen on Saturday February 03, 2018 @12:03PM (#16298383)
It's not just syntactic differences either: they behave differently with regard to whether they're hoisted and the value of this.