0
can anyone tell me what's wrong with this code? i want it to response with input 1 once the user type "no"
let input1 = prompt("hi! what's on your mind?") while (true) { input = prompt("is that really what you think?"); if (input === "no") { input = prompt(input1) } else if (input === "yes") { prompt("Okay!"); { break; } } }
3 Answers
+ 3
It doesnt look like you've declared input correctly in the line under the while condition.
Maybe save the code and attach it, like this guide says and then people can better help:
https://code.sololearn.com/Wek0V1MyIR2r/?ref=app
https://code.sololearn.com/W0uW3Wks8UBk/?ref=app
0
i'm not quite sure how to correct that
0
Debug:
let input1 = prompt("hi! what's on your mind?")
while (true) {
input = prompt("is that really what you think?");
if (input === "no") {
input = prompt(input1)
} else if (input === "yes") {
alert("Okay!"); // { - debug 1
break;
// } - debug 2
}
}