One of the causes that may be preventing the execution of the code has already been pointed out by @Isac: the prompt
method returns a string. So, if you want to test as a number, you can use the parseInt
function to convert the prompt string to integer, as the name itself says.
The other cause that may also be preventing the code from running is that when you compared the equality between numero
and palpite
, you used the assignment operator =
, instead of the operator of equal ==
.
I hope I have helped!