Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8070855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:31:25+00:00 2026-06-05T13:31:25+00:00

A less well-known feature of JavaScript is that you can use labels to break

  • 0

A less well-known feature of JavaScript is that you can use labels to break and continue out of nested loop and switch statements:

i_loop: for (i = 0; i < 10; i++) {
    j_loop: for (j = 0; j < 10; j++) {
        if (i == 3 && i < j)
            break i_loop;
    }
}

This feature is the answer to:

  • Best way to break from nested loops in Javascript?

  • How to break nested loops in javascript?

My question is, how portable is it? The MSDN documentation has a long list of supported IE versions. The Mozilla documentation says it was implemented in JavaScript 1.2 (released in 1997), and that it is in ECMA-262, 3rd Edition (1999). Going by this, labels should be extremely portable, but can I count on it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:31:26+00:00Added an answer on June 5, 2026 at 1:31 pm

    According to MDN, a labelled break is supported since the “ECMA-262, Edition 3” standard (published in December 1999, so I believe there should not be a single browser out there that does not support it :))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's well known that using forward declarations is preferable to using #includes in header
Java 5 has introduced many features that can be make logging statements less cluttering,
It is well known that updating a Swing GUI must be done exclusively in
The java.lang.System class defines a number of well-known properties . For example, you can
I am an absolute newbie to Perl as well as programming in general(less than
Possible Duplicate: Sleep Less Than One Millisecond How can I make a program sleep
There're two well-known ways to set an integer register to zero value on x86.
I can't imagine that there doesn't exist an efficient, lightweight, secure authentication and authorization
I'm trying to write an application that will work well on all screen sizes,
I have a C# collection of strings. Each string is a sentence that can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.