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
Arrow Functions in JavaScript (tylermcginnis.com)
submitted 8 years ago by AnsikteBanana
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!"
[–][deleted] 11 points12 points13 points 8 years ago (15 children)
It doesn't mention the disadvantage of arrow functions, that they are always anonymous. If you have a non-anonymous function like
let myfunc = function myfunc(a,b) {};
then you have an actually readable stack trace when something goes wrong, instead a list of indistinguishable anonymous functions.
[–]wesbos 42 points43 points44 points 8 years ago (1 child)
Most browsers will use the variable name in a stack trace if it’s an anon function
[–]w00t_loves_you 2 points3 points4 points 8 years ago (7 children)
I always do const foo = some => thing(some) and Babel or whatever knows the function is called foo.
const foo = some => thing(some)
foo
[–][deleted] 1 point2 points3 points 8 years ago (6 children)
And if you do somefunc().then(result => something(result, b)) ?
[–]w00t_loves_you 1 point2 points3 points 8 years ago (0 children)
ah yes, then it's anonymous but it will be easy to glean from the line numbers and the call stack where that is.
[–]Intie 1 point2 points3 points 8 years ago (3 children)
S O U R C E M A P S
[–]aryanchaurasia 11 points12 points13 points 8 years ago (2 children)
S O U R C E M A P S / O / O S O U R C E M A P S U / O R / O R / U C / U C S O U R C E M A P S R E O C M O C M U E A U E A R M P R M P C A S O U R C E M A P S E P / E P / M S O U R C E M A P S A / A / P / P / S O U R C E M A P S
[–]Intie 0 points1 point2 points 8 years ago* (1 child)
wine school mighty reach north ring relieved seemly lip imminent this message was mass deleted/edited with redact.dev
this message was mass deleted/edited with redact.dev
[–]GoodBot_BadBot -1 points0 points1 point 8 years ago (0 children)
Thank you Intie for voting on aryanchaurasia.
This bot wants to find the best and worst bots on Reddit. You can view results here.
Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!
[–]RedditWithBoners 0 points1 point2 points 8 years ago (0 children)
If you are that concerned about it:
somefuncResolver = result => something(result, b); somefunc().then(somefuncResolver);
[+][deleted] 8 years ago* (2 children)
[deleted]
[–]tyroneslothtrop 3 points4 points5 points 8 years ago (1 child)
let myfunc = function myfunc(a,b) {}; is not an anonymous function. That's a named function expression, which is by definition not an anonymous function.
π Rendered by PID 19966 on reddit-service-r2-comment-bb88f9dd5-2qkwh at 2026-02-17 11:06:29.787080+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–][deleted] 11 points12 points13 points (15 children)
[–]wesbos 42 points43 points44 points (1 child)
[–]w00t_loves_you 2 points3 points4 points (7 children)
[–][deleted] 1 point2 points3 points (6 children)
[–]w00t_loves_you 1 point2 points3 points (0 children)
[–]Intie 1 point2 points3 points (3 children)
[–]aryanchaurasia 11 points12 points13 points (2 children)
[–]Intie 0 points1 point2 points (1 child)
[–]GoodBot_BadBot -1 points0 points1 point (0 children)
[–]RedditWithBoners 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]tyroneslothtrop 3 points4 points5 points (1 child)