Monday, October 23, 2017

CallBack in JavaScript. (Simple javascript function with callback)

function abc(option, callback){
if (option == 1) {
  callback         // no () here
  }
}

function test (){
abc(1, hello())
}
function hello(){
alert('this is hello fnc used as callback');
}
test(); // Finally call here

No comments:

Post a Comment