/secretPassword.js Secret
Created
April 27, 2016 23:59
This file contains hidden or 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 secretPassword() { | |
var password = 'xh38sk'; | |
return { | |
guessPassword: function(guess) { | |
if (guess === password) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
} | |
} | |
var passwordGame = secretPassword(); | |
passwordGame.guessPassword('heyisthisit?'); // false | |
passwordGame.guessPassword('xh38sk'); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment