infinite loop

A loop or cycle that never stops, because the condition that should end it is never reached.

In more detail

It usually shows as a frozen page or a program that never finishes, and often means the code forgets to update the value the stopping condition checks. In a terminal, Control-C interrupts the program. Some loops are deliberately endless and are left from inside with return or break.

Examples

In Idle, Restart Shell stops a runaway loop.
In React it often comes from setting state during render, an Effect whose dependency is a new object every render, or getSnapshot returning a new object on each call.

Related terms

Taught in

References

Certification courses