In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about what the loop structure of the JavaScript program is. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Select structure
Single branch if structure
If (condition) {Code executed after the condition is met}
If there is only one statement in the curly braces, you can omit the curly braces at this time, but it is strongly not recommended
If (conditional) console.log ('dot')
Two-branch if structure statement
If (condition) {code executed after the condition is satisfied} else {code executed after the condition is not met}
Multi-branch if structure statement
If (condition 1) {Code 1} else if (condition 2) {Code 2} .else {none of the above conditions satisfy the executed code}
Switch structure
Var today=1switch (today) {case 1: console.log ('working day') break case 2: console.log ('working day') break case 3: case 4: case 5: console.log ('working day') break Default console.log ('rest Day') break
The difference between switch and if
Switch can only wait. It's worth judging if.
There is no limit to the judgment suitable for a continuous interval.
Cyclic structure
Performing an operation repeatedly is a loop.
While// cycle 10 times var i=1while (I
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.