Created
May 23, 2015 21:21
-
-
Save ungoldman/4065d5da8257607ae645 to your computer and use it in GitHub Desktop.
basic callback example
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 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