Skip to content

Instantly share code, notes, and snippets.

@ungoldman
Created May 23, 2015 21:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ungoldman/4065d5da8257607ae645 to your computer and use it in GitHub Desktop.
Save ungoldman/4065d5da8257607ae645 to your computer and use it in GitHub Desktop.
basic callback example
function first (input, callback) {
var output = input.reverse()
callback(output)
}
function second (output) {
console.log(output)
}
first([1,2,3], second)
first([1,2,3], function (output) {
console.log('hey', output.join('-'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment