In JavaScript, functions are objects, and they can:
- Be passed as an argument to another function
- Return as a value from a function
- Be assigned to a variable
Let’s assume that you have a JavaScript function (let’s call it function A) with the following properties:
- 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:
Leave a Reply