Created
February 11, 2015 02:18
-
-
Save danielkhan/ac4ec76e8bad0a5f0600 to your computer and use it in GitHub Desktop.
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 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