I\'m trying to learn javascript and am creating a rudimentary hangman game. However, I keep getting an error when trying to break out of my loop. I can\'t figure it out for the
Without seeing the rest of the code to understand the scope I would assume that you are using break incorrectly. Instead you should be using return.
Break is used inside loops (for, while, for in, switch etc). Where as return is used to return from functions, if blocks and can either return a value or not.
if (guess === null) {
return;