Skip to content

Instantly share code, notes, and snippets.

@imkrish
Created September 22, 2018 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imkrish/203091c265db373ebd08837519f7ded3 to your computer and use it in GitHub Desktop.
Save imkrish/203091c265db373ebd08837519f7ded3 to your computer and use it in GitHub Desktop.
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