I'm trying to loop indefinitely until a condition is met...is the following correct?
It seems not to be.
var set = false;
while(set !== true) {
var check = searchArray(checkResult, number);
if(check === false) {
grid.push(number);
set = true;
}
}
Basically, you can make an infinite loop with this pattern and add a break condition anywhere in the loop with the statement break
:
while (true) {
// ...
if (breakCondition) {
break;
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments