I made this project using vanilla JavaScript
Adding spaces was a significant challenge when I made this. I had to use several string manipulation functions to make sure that the space was preserved as a space between words but was not a letter that the player was required to guess. I handled this by splitting words at spaces and then using a forEach loop to run through each word and display the appropriate number of spaces.