problem #1121
CoderTahmid
started this conversation in
Students
problem
#1121
Replies: 1 comment
-
|
The code logic is correct, but it doesn’t run properly due to two main reasons:
prompt() always returns a string, while gameNum is a number. Fix: Convert the input to a number using Number().
If this code is run in VS Code terminal or Node.js, it will not work because prompt() is a browser-only function. let gameNum = 25; while (userNum !== gameNum) { console.log("Congratulations, you entered the right number"); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why this code isn't running in my PC correctly?
Beta Was this translation helpful? Give feedback.
All reactions