Infinite loop: Difference between revisions

Content deleted Content added
m Added JS
Tags: Reverted Visual edit
Undid revision 1136640783 by Learning With Ameer (talk): unencycopedic style; we don't need to show the complete zoo of languages, and the LS example is essentially a repetition of the JAVA example
Line 148:
}
</syntaxhighlight>
The form <code>for (;;)</code> for an infinite loop is traditional, appearing in the standard reference ''[[The C Programming Language]]'', and is often punningly pronounced "forever".<ref>{{Cite web |url=https://stackoverflow.com/questions/20186809/endless-loop-in-c-c |title=Endless loop in C/C++ |url-status=live |archive-url=https://web.archive.org/web/20160803202212/http://stackoverflow.com/questions/20186809/endless-loop-in-c-c |archive-date=2016-08-03}}</ref>
 
This is a loop that will print "Infinite Loop" without halting.
Line 184:
loop {
println!("Infinite loop");
}
</syntaxhighlight>And of course, who'd forget JavaScript?<syntaxhighlight lang="javascript">
while (true) {
console.log("Infinite Loops!");
}
</syntaxhighlight>