Created
April 20, 2018 20:18
-
-
Save vontell/9c5fa85b255d707e9305c1bd11e96834 to your computer and use it in GitHub Desktop.
Callback Example for Tej
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
function imAFunction(message, callback) { | |
console.log("Here is the message you passed in: " + message); | |
// Now I'm gonna pass call the callback function with a boolean | |
callback(true); | |
} | |
imAFunction("Hello!", function(bool) { | |
// 'bool' is the true passed in from line 4 | |
console.log(bool); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment