Skip to content

Instantly share code, notes, and snippets.

@danielkhan
Created February 11, 2015 02:18
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 danielkhan/ac4ec76e8bad0a5f0600 to your computer and use it in GitHub Desktop.
Save danielkhan/ac4ec76e8bad0a5f0600 to your computer and use it in GitHub Desktop.
function isValidUser(username, cb) {
if(username !== 'Frank') cb("Access denied!");
cb("Access granted!")
}
isValidUser("Tom", function(msg) {
// This will output "Access denied!" AND "Access granted!"
console.log(msg);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment