r/javascript • • Mar 31 '17

ES2018 First Look - it changes everything

https://www.youtube.com/watch?v=s-G_RZ4RJLU
464 Upvotes

120 comments sorted by

View all comments

25

u/azangru Apr 01 '17

I actually listened to a fresh interview with Brendan Eich yesterday, where he said that the keyword function he chose when he was prototyping JavaScript turned out to be a bit on the longish side for the JavaScript parser, which negatively affected its speed; so when the video mentioned the shortcut for the function keyword, it sounded a little too real.

19

u/delventhalz Apr 01 '17

To be honest, I wouldn't mind being able to use fn or func.

3

u/Disgruntled__Goat Apr 01 '17

Why? I was under the impression no one uses function at all now.

0

u/[deleted] Apr 01 '17

[deleted]

20

u/ajacksified Apr 01 '17

() => 'welcome to the future'

14

u/GBcrazy Apr 01 '17

Well you can't really reuse arrow functions unless you put it into an object. Also it always binds this...there are some scenarios where this arguably isn't wanted

5

u/ajacksified Apr 01 '17 edited Apr 01 '17

I feel like my current 0 karma is the number of people who understand sarcasm

Edit: and anyways if you don't want to bind this, don't use an arrow function

Edit2: can't reuse functions? What are you even talking about, that makes no sense

1

u/Wooshception Apr 01 '17

Always use the /s operator :)

/!s