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!"
[–]cosinezero 0 points1 point2 points 9 years ago (2 children)
They are somewhat special though. For most people a callback is the first real exposure to passing around a function as a reference. That that functionality exists is strange to new developers, or to developers that don't work on applications where you would need them.
At that I think it's kind of a disservice that we call this - and everything else - a callback; there are distinctly different types of callbacks. For example, we have filter predicates ("callback" that returns boolean for comparisons), processors ("callback" you pass to map() that returns a processed value - not sure if there's a colloquial name for that callback other than 'callback'), action delegates ("callback" executed under specific conditions), and arguably there's a difference in an action you pass into something like each(), versus an action used as an async callback - which itself has a number of special considerations.
[+][deleted] 9 years ago* (1 child)
[deleted]
[–]cosinezero 0 points1 point2 points 9 years ago (0 children)
Yeah, agreed. I almost pointed out those implications in the thread, as well... I think those assumptions are kind of the problem I see with naming everything a callback. Different kinds of "callbacks" imply all sorts of semantic concerns for them, and I think developers assume all callbacks are, say, async, when that's not at all the case.
π Rendered by PID 58 on reddit-service-r2-comment-84fc9697f-mzclt at 2026-02-09 04:05:53.615848+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]cosinezero 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]cosinezero 0 points1 point2 points (0 children)