Skip to content

Instantly share code, notes, and snippets.

@thomasfr
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasfr/414b98224059d06d8db0 to your computer and use it in GitHub Desktop.
Save thomasfr/414b98224059d06d8db0 to your computer and use it in GitHub Desktop.
var foo = function(text, callback) {
if(text == "hello") {
callback("hello world");
console.log("Someone said hello");
}
callback("why don't you say hello?");
console.log("nobody likes me :(");
}
foo("hello", function(result) {
console.log(result)
});
foo("asdasdasd", function(result) {
console.log(result)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment