-
Notifications
You must be signed in to change notification settings - Fork 2
FreeCodeCamp Loops Protection
The Free Code Camp code runner has a built in Infinite Loop Protect feature, leveraged from JSBin's Loop Protect. The loop protect injects some code into user created loops to allow a safe exit if more than ~500ms has passed without exiting the loop. Loop protect will catch many, but not all infinite loop issues. If you see this message:
Error: Potential infinite loop at line X
It means you have been protected from an infinite loop.
Note: Loop Protect cannot detect infinite recursion.
In some cases - a slow computer or a long loop - you may get an incorrect loop protect. In order to disable loop protect, add the following comment over the line the loop protection message lists:
//noprotect
Warning: Disabling loop protect means you may potentially allow your code to go into an infinite loop, causing your browser to be unresponsive.
If you have erred and incorrectly disabled loop protection and now have an unresponsive solution, you can Disable Code Auto-Run.
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links