Last active
November 23, 2017 14:46
-
-
Save maecapozzi/b3d82bfb786151bba6942dd2f5e7a249 to your computer and use it in GitHub Desktop.
Displays a greeting using a callback
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
const greeting = (name) => { | |
console.log('Hello ' + name) | |
} | |
const processUserInput = (callback) => { | |
let name = prompt('please enter your name') | |
callback(name) | |
} | |
processUserInput(greeting) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment