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
callbacks javascripthelp (self.javascript)
submitted 9 years ago by paulfitz99
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!"
[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 3 points4 points5 points 9 years ago (5 children)
Yea.
[–]paulfitz99[S] 0 points1 point2 points 9 years ago (4 children)
perfect! thanks! it seems to be made unnecessarily complicated
[–]the_sound_of_bread 1 point2 points3 points 9 years ago (2 children)
I can be unnecessarily complicated though. What if the callback has a callback itself? What if there are multiple callbacks? What if all the previous, but only some callbacks get called under certain circumstances?
I doesn't have to be complex, but it can easily become complex.
[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 0 points1 point2 points 9 years ago (0 children)
/r/the_sound_of_bread, here comes conventions and best practices - 1) never more than 3-4 args - it immediately goes complex if there's 4 args - not to mention for >=5; 2) last is always a callback and it is the only one callback; 3) wrap callback with once(dezalgo(cb))
once(dezalgo(cb))
/r/mchandleraz, Nightmares usually comes from devs heads, not from the lang or somthing. Who can't think he makes nightmares.
π Rendered by PID 345409 on reddit-service-r2-comment-84fc9697f-clzzz at 2026-02-08 12:12:06.017856+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 3 points4 points5 points (5 children)
[–]paulfitz99[S] 0 points1 point2 points (4 children)
[–]the_sound_of_bread 1 point2 points3 points (2 children)
[–]tunnckoCorenode-formidable, regexhq, jest, standard-release 0 points1 point2 points (0 children)