callback()

 callback() : a callback() function is a function passed into another function as a argument which is then invoked inside the outer function to complete the specific routing or action.

function greeting(name){

alert(hi, ${name});

}

function userInput(callback){

name= prompt('enter name');

callback(name);

}

userInput(greeting);

This is a syschronous callback(). It’s executed immediately

asynchronous means multiple executions are happening at the same time with different channel

Comments

Popular posts from this blog

Become a Expert + Secret of Success -- ii

Change Detection

without writing media queries How to make responsive component