if != implys that the initialized is unequal to 4 and it creates an infinite loop, then why does >=4 (init greater than four) resolute to “undefined” and does not create any loop, whereas <=4 (init 1, true statement) creates an ending loop… shouldn’t any False condition create an infinite loop?
function myFunc() {
for (let i = 1; i = 4; i += 2) {
console.log("Still going!");
}
}
console.log(myFunc());
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Challenge: Prevent Infinite Loops with a Valid Terminal Condition
for (let i=1; i!=4; i+=2) {
console.log(“i=”, i);
}
So if loops are made when conditions are True, may I ask how the given != creates a loop although it is as false as >=4, shouldn’t any number greater than 1 be regarded as != as well?
condition >=4 registers undefined in the terminal and not an infinite loop as is declared with the condition !=, is it a limitation of the FCC terminal?