Skip to content

Instantly share code, notes, and snippets.

@projektorius96
Created January 2, 2019 10:00
Show Gist options
  • Save projektorius96/9eb9b66d968923a38bd7f1c6f378aaaf to your computer and use it in GitHub Desktop.
Save projektorius96/9eb9b66d968923a38bd7f1c6f378aaaf to your computer and use it in GitHub Desktop.
Callback syntax
// callback executer
let y = function(doCallBack) {
console.log("This is dependent function expression which will inquire callback");
doCallBack(); /* doCallBack parameter defined and executed itself inside dependant function expression ensure callback as argument will be inquired and returned subsequently */
};
// calback ifself
let x = function() {
console.log('This is the body of independent function expression, which says: "I am callback called as argument"');
};
y(x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment