Fat arrow functions lexically bind this value, so it is more predictable for people coming from other languages.
When you have window as a this value it doesn't help anyone, it's clearly not intended, and depending in the caller of the function to call it correctly is risky
I completely agree, which is more reason to avoid to my above mentioned list.
I can understand why that would make ES6 more desirable, but not why so many developers on here sound as if they cannot live without it. How can people not live without it if these features are less than a year old in the browser and ES6 is not even finished yet?
It's hard to explain, but for me is all about familiarity, my first language was Java, and I also use Java on the server. So when I write this I expect it to be something. Using ES6 short function syntax I can write safer code. I could write Javascript without using this but is not a real alternative when you use most of the real world frameworks.
And the short syntax helps to improve readability and reusability of functions!
See, that's a problem. It's all very nice having these short forms, but readability for those used to a different language is not a valid reason for having them. Does Spanish add arbitrary constructs to make it easier for English speakers?
1
u/zoeshadow Mar 09 '15
Fat arrow functions lexically bind this value, so it is more predictable for people coming from other languages.
When you have window as a this value it doesn't help anyone, it's clearly not intended, and depending in the caller of the function to call it correctly is risky