+ 2
Failed to stopping loop
I tried to create a file that contains javascript while loop and data type validator. When the file runs, it will ask you integer numbers and when it's false, it will ask you again through prompted window Here's the problem : First, the loop can't be stopped even the value of tested variable is true. https://code.sololearn.com/W25p4I4Kglbh/?ref=app Second, what should I do if the value of a and b if they redirected to x and y? How to let a and b not counted because they don't have value? Note : please don't open the code if you don't want to get prompted loops
10 Antworten
+ 2
if you are right the value always gives false so it does not stop
+ 2
And what if you try if else in while (true) to stop it
+ 1
I added the second '=' thanks
+ 1
Good night, would you like me to give you the code already solved or would you like me to tell you where the error is?
+ 1
Daniel Briceño the loop, it can't stop even the value is true
+ 1
example:
a=prompt();
if(a)//condicion
continue;
else
a=parseInt(a);
+ 1
I'm going to try it
+ 1
How are you doing with the code if you want I give you my solution but the question is that you solve it yourself.
Do you want my solution?
+ 1
Sure, I will find the mistake and retry it
+ 1
Good luck