Skip to main content
D
JavaScript
JavaScript Break

JavaScript Break

JavaScript break statements jump out of a loop early.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript uses the `break` statement to stop a loop immediately, even if the condition is still true. Developers use this when searching for a specific item; once they find it, there is no need to keep searching.

Example

Example
1/* this stops the loop at 3 */
2for (let i = 0; i < 10; i++) {
3  if (i === 3) { break; }
4  console.log(i);
5}

Key Points

  • The `break` statement kills the loop entirely.
  • The `continue` statement skips only the current iteration.
  • Switch statements also rely on `break`.
  • Using `break` makes code run faster by stopping unnecessary work.

Up Next

Continue your journey with the next topic.

Go to JS Type Conversion