What is a Callback Function in JavaScript
You know how you ask someone to call you back in a phone conversation? That’s what callback functions are. They are functions to be called later; after something has happened. In order to grasp this in practice, one needs to understand two things that there is a difference between a function name fn and a function call fn(), that functions can be passed into functions as arguments, the same way that numbers, strings and arrays are passed into functions as arguments The difference between a function name and a function call Let’s consider the code snippet below...