Answers for "9.4.1.2. Loop Condition¶ (Infinite Loop)"

0

9.4.1.2. Loop Condition¶ (Infinite Loop)

/*It is critical that the loop condition eventually becomes false. A loop
for which the condition is never false is known as an infinite loop, 
because it never stops iterating. A program that contains an infinite 
loop will only stop after running out of memory or being manually 
stopped (for example, using control+c in a terminal).*/

//This is an infinite loop, because its condition will always be true.
for (let i = 0; i > -1; i++) {
   console.log("LaunchCode");
}
Posted by: Guest on June-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language