Adding hangman game in Javascript