February 2019
Beginner
694 pages
18h 4m
English
One of the most powerful features of JavaScript and, in fact, the technology that Node was built on, is the concept of callback functions. A callback function is a function that is passed into another function, and is then generally invoked inside the function. This is how asynchronous programming is achieved. By supplying a callback function, we are saying to the function we are calling, go and do what you need to do, and then when you are finished, call this function. Just as we can pass a value into a function, we can also pass a function into a function.
This is best illustrated by taking a look at some sample JavaScript code:
var callbackFunction = function(text) { console.log('inside callbackFunction ' + text); } ...Read now
Unlock full access