Skip to content

Commit 16a7fbd

Browse files
Dictionary (New Word): Infinite Loop (#84)
# Word #### Infinite Loop # Meaning/Definition An infinite loop is a loop that has no end. A loop that has a terminating condition that can never be met. To some certain conditions it can be useful but most times causes issues when not properly handled. Example of an infinite loop in JS is a while loop while (true) { console.log("This will run forever."); } --------- Co-authored-by: Olabode Lawal-Shittabey <babblebey@gmail.com>
1 parent 3e9af94 commit 16a7fbd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: ../../layouts/word.astro
3+
title: "Infinite Loop"
4+
---
5+
An infinite loop is a loop in programming that **never stops running** because the ending condition is never met (or missing).
6+
7+
**Key idea**:
8+
9+
- Normally, loops run until a condition becomes false.
10+
- In an infinite loop, that condition always stays true (or there’s no way to exit).
11+
12+
**Example (JavaScript):**
13+
14+
```js
15+
while (true) {
16+
console.log("This will run forever!");
17+
}
18+
```
19+
20+
This loop will keep printing endlessly until the program is stopped.

0 commit comments

Comments
 (0)