Skip to content

Instantly share code, notes, and snippets.

@maecapozzi
Last active November 23, 2017 14:46
Show Gist options
  • Save maecapozzi/b3d82bfb786151bba6942dd2f5e7a249 to your computer and use it in GitHub Desktop.
Save maecapozzi/b3d82bfb786151bba6942dd2f5e7a249 to your computer and use it in GitHub Desktop.
Displays a greeting using a callback
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