The reason `!=` works here (and `!==` doesn't) is that you're comparing a string to an integer. With `!=` and `==`, JavaScript tries to convert the sides to the same type before comparing them -- but this logic is very error-prone and should not be relied on. Instead, use `guess = parseInt(prompt(...))` to explicitly make the guess an integer.