# Infinite Loop

*noun*

say it: **“IN-fih-nit LOOP”** **/ˈɪnfɪnɪt luːp/**

A loop whose condition never becomes false, so it repeats forever and the program never moves on.

## What is **Infinite Loop** in JavaScript?

**Infinite Loop** — A loop whose condition never becomes false, so it repeats forever: the program hangs, or the page freezes. It usually means the loop forgot to change the variable its condition checks. In the terminal, Ctrl+C stops it.

```javascript
let bikesLeft = 3;
while (bikesLeft > 0) {
  console.log(`Bikes left: ${bikesLeft}`); // 3, then 2, then 1
  bikesLeft--; // without this line, the loop never ends
}
```

## In a sentence

- “I forgot to add 1 to count, so my **infinite loop** printed the same line until I pressed Ctrl+C.”

Level: Novice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=1)

Updated: November 9, 2026

## In other subjects

- [Infinite Loop in C#](https://www.ask-codey.com/glossary/infinite-loop-c-sharp)
- [Infinite Loop in Java](https://www.ask-codey.com/glossary/infinite-loop-java)
- [Infinite Loop in PowerShell](https://www.ask-codey.com/glossary/infinite-loop-powershell)
- [Infinite Loop in Python](https://www.ask-codey.com/glossary/infinite-loop)

Source: https://www.ask-codey.com/glossary/infinite-loop-javascript
