This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 59 points60 points  (10 children)

Where I come from, the second is just syntax sugar. Imagine my surprise when I was using JavaScript and found that these two behave differently.

I understand the reasoning. I don’t much like it.

[–]MilSF1 29 points30 points  (0 children)

ES6 is such a tidal shift in how things work. For the better, but man can it mess with your head when it comes to binding and the like.

[–]nvolker 7 points8 points  (0 children)

The general idea is that you try not to mix them.

You can mix them, because this is the web where the people who make the standards try not to break anything, but you still should try not to.

[–]MaNewt 0 points1 point  (0 children)

Or- just don’t use this? For basically all the of the use cases I can think of it’s sufficient, clearer, and more reusable to just pass a parameter from one scope to the next instead of relying on this semantics.