Hangman in JavaScript