-
-
Save iam-peekay/5cd5a8d15d3b92b73b31a21995c7f34a 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 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