Created
September 22, 2018 08:39
-
-
Save imkrish/203091c265db373ebd08837519f7ded3 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 hangman(secretWords: string, ...letters: string[]) { | |
return ( | |
secretWords | |
.split('') | |
.sort() | |
.join() === | |
letters | |
.filter(letter => secretWords.includes(letter)) | |
.sort() | |
.join() | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment