April 2018
Beginner
226 pages
4h 47m
English
The callback is a simple, anonymous function that is passed as a parameter and invoked when required inside another function's scope. Consider the following snippet:
function greetAll(callback){ console.log("Hello Readers!"); console.log(`Greeting from the ${callback()}`)}greetAll(()=>{ return "Author";})
In the preceding code, we have a greetAll function that contains a simple parameter named callback. On invocation of the greetAll function, we have passed an anonymous function as a parameter. Henceforth, greetAll is executed in a programming context that performs the following stepwise operation:
Read now
Unlock full access