0
How to solve this practice
What is wrong with my code? It is from Web development course in the last module of JS - Practice Verification let pin = 2345(prompt("Enter pin")); // log "Success" to the console if user input matches 1345 if (pin = 1345) { console.log("Success"); } // log "Fail" if user input doesn't match the given pin else { console.log("Fail"); }
7 Answers
+ 4
Samuel ZelĂska are you trying to make pin a variable '=' in the if condition statement or trying to compare '==' đ€
I think đ€ you simply forgot something here
var x =
if x ==
+ 3
Jan yes it's the same one...
A CAPTCHA is a type of challenge test used in Web pages to check that the user is a human.Â
The given code stores the pin that the user entered.
Task
Â
Complete the code to log Success or Fail to the console based on the results of the test. The given pin is 1345
it's just before "More on Conditions"
+ 3
BroFar I tried to uninstall and then reinstalled the app, but that task is still not available in the Web Development course.
In the Introduction to JavaScript course, the task appears under the name, Verification.
Maybe something messes up if SL has a reference to the same task in two different courses, so the task only appears in one course but not in another course.
+ 2
It's a little bit weird, because I don't have that task in the Web Development course, but I have it in the Introduction to JavaScript Course, and it doesn't take any kind of inputs.
+ 2
Samuel ZelĂska I have completed Web Development course, but for some reason, that Verification task is not available i my version of the course, but the Verification task was available when I completed the Introduction to JavaScript course, and it didn't require any external input from a prompt or anything else, so could you please share the description from the Web Development course of that Verification task so we can find out whether the Verification task takes input or not?
As I mentioned, it didn't take any input in the Introduction to JavaScript course, so I think it might be the same in the Web Development course.
+ 1
Remove the rest of the line after 2345.
It should be like this....
let pin = 2345;
0
It shows this error message:
The error occurs because `prompt` is not available in Node.js. Use a different method, like `readline`, to get user input in a Node environment.
I don't know what else can I try, nothing works