Created
January 2, 2019 10:00
-
-
Save projektorius96/9eb9b66d968923a38bd7f1c6f378aaaf to your computer and use it in GitHub Desktop.
Callback syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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