My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

JavaScript Arrow Functions - WHY?!?

Jason Knight's photo
Jason Knight
·Apr 6, 2018

Why do these ACTUALLY exist now. What do these 'do' that saying 'function' and 'return' do not? The ONLY thing I can seem to find that serves ANY purpose with them is to either make it so that your script CANNOT be run in any version of IE, or that you're too lazy to type those two words.

I'm not seeing any corner case usages where they have any legitimate advantage -- in fact under blink and chakra they are even slower than anonymous functions and suck down more memory! Though they are reasonably well behaved in Quantum

Can anyone provide me with a legitimate reason to use them other than "wah wah, I'm too lazy to type"? That bit of the equation reading sources I trust (like MDN) and even some I don't (like the dirtbag scam artist W3Schools) are failing to provide me with that missing part of the equation.

WHY are these even a thing apart from intentionally trying to make the language more cryptic, harder to use, and "wah wah, you means I haz to tieps wurds?!?"

I'm just not seeing it. Can anyone give me an actual usage case scenario where it makes a real difference?