Last active
May 30, 2021 22:53
-
-
Save shelbyspees/482d9cc3cf5ff36375894a615ab8796c to your computer and use it in GitHub Desktop.
this is how callbacks work, Shelby
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 printName(name, callback) { | |
console.log(`Player name: ${name}`); | |
function callback( | |
// normally you'd define parameters here right? | |
// does this ever get used? | |
) { | |
// what's the point of these curly braces? | |
} ( | |
console.log("inside callback") | |
); | |
} | |
printName("shelby"); | |
// $ node printName.js | |
// inside printName.js! | |
// Player name: shelby | |
// inside callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Things I tried