Understanding Callbacks and Closures
IN THIS CHAPTER
Understanding callback functions
“O, call back yesterday, bid time return.”
— EARL OF SALISBURY, RICHARD II
What Are Callbacks?
Functions, like any other object, can be assigned to variables, be passed as arguments to other functions, and created within and returned from functions.
Passing functions as arguments
Function objects contain a string with the code of the function. When you call a function by naming the function, followed by ( ), you’re telling ...