Hangman game in JavaScript