Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the jump statements in javascript

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The content of this article mainly focuses on what are the jump sentences in javascript. The content of the article is clear and clear. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!

Two kinds of jump statements in javascript: 1, break statement, used to exit the loop or exit a switch statement, let the program continue to execute the code after the loop, syntax "break;"; 2, continue statement is used to exit this loop and start the next loop, syntax "continue;".

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

There are two main jump statements supported by javaScript:

Break statement

Continue statement

The main difference between the break statement and the continue statement is that break ends the loop completely and continue ends the loop.

1. Break statement:

Break statements are used to exit a loop or a switch statement, allowing the program to continue executing the subsequent code. Break statements are usually used in while,do...while,switch or for statements

Syntax:

Break

Description:

Break statements are usually used in while,do...while.switch or for

For example:

The break statement var n = 50; var sum=0; for (var item0

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report