Skip to content

Instantly share code, notes, and snippets.

@vontell
Created April 20, 2018 20:18
Show Gist options
  • Save vontell/9c5fa85b255d707e9305c1bd11e96834 to your computer and use it in GitHub Desktop.
Save vontell/9c5fa85b255d707e9305c1bd11e96834 to your computer and use it in GitHub Desktop.
Callback Example for Tej
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