- Be passed as an argument to another function
- Return as a value from a function
- Be assigned to a variable
- Function A takes another function (let’s call this one function CB) as one of the parameters.
- Function A executes the function CB in its body
In the above scenario, function CB is known as the Callback function. Let’s learn more about it using the following code: