Call back function is very important for us. Because we are need to use this function regularly.
The defination is callback function -
When we are passed a function as a argument in another function. When need to call this function , we can just call this argument , and if it is run correctly as a function that is called callback function.
const getVar = () => {
setTimeout(function() {
console.log('A Function that takes some time');
}, 3000)
}
const printSomething = () => {
console.log('Another Function');
}
getVar();
printSomething();
Top comments (0)