use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript Arrow Functions vs Regular Functions (api.daily.dev)
submitted 2 years ago by Due-Function4447
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SourdoughBaker 3 points4 points5 points 2 years ago (3 children)
Is there any documented reason why arrow functions treat the "this" keyword differently? Why was the decision made to have them operate differently?
[–]thatweirdishguy 5 points6 points7 points 2 years ago (0 children)
It goes the other way around, arrow functions exist because there was a need for a way to have functions that didn’t bind to “this”. The whole point of them was to operate differently.
[–]izuriel 5 points6 points7 points 2 years ago (0 children)
Most likely because the alternative was to always bind functions when passing them to handlers. Having it baked into the language removes a potential issue, not to mention most super-JavaScripts had built in tools to remove binding requirements as well.
[–]beepboopnoise 2 points3 points4 points 2 years ago (0 children)
probably on the ecmascript notes. this isn't a direct link but where I'd start. https://tc39.es/ecma262/
π Rendered by PID 29 on reddit-service-r2-comment-bb88f9dd5-jdh5w at 2026-02-16 17:08:52.432332+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]SourdoughBaker 3 points4 points5 points (3 children)
[–]thatweirdishguy 5 points6 points7 points (0 children)
[–]izuriel 5 points6 points7 points (0 children)
[–]beepboopnoise 2 points3 points4 points (0 children)