Created
March 26, 2018 19:57
-
-
Save aryak007/881df6ac3553bc8e6833ce55c610619b 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