GLOSSARY · A WORD, UNPACKED
callback
a function you hand to another function to be run when needed, immediately or later.
A little more detail
Callbacks often handle later work, such as a timer or request. A callback does not have to be asynchronous, though: map calls its callback while map itself is running. Hand over the function value when you want the receiving API to call it; calling the function first hands over its result instead. When a callback needs surrounding state, a closure can retain that access.
See it in practice
These lessons pair the idea with examples you can change and run.