The code looked alright, but I did have to make some modifications to get it to work both correctly and how I wanted it to.
After all, it wanted the player to play the game in the browser’s
alert boxes. Yuck.
ChatGPT only gave me six different words to use in the game, so I grabbed this list of the top 1000 English words and filtered by words that were at least four letters long.
Word Guessing Game
Guess the word by typing a letter.