First, Process Control OverviewProcess Control of the program-Program = data + algorithm-Any complex program algorithm can be implemented by "order", "branch", "Loop" three basic program logic combinations650) this.width=650; "src="
In fact, the meaning of "if else" is the same as the literal meaning, that is, "if" or "otherwise". Let's take a look at an example that uses if.
If you're writing a program for a robot, the robot's function is to evaluate the user's hobby.
Robot:
My answer is: If of more than two else, or switch of more than two cases. However
Code Is it normal to use if else and switch case in large quantities? Error! If else and switch case with more than two branches should not be hard-coded.
Where
My answer is, more than two else if, or switch for more than two case. But is it normal to use a lot of if else and switch case in your code? Wrong! Most of the more than two of the if else and switch case should not appear as hard coded (hard-coded)
- , StatementConcept: a semicolon (;) represents the end of a statementHabit: Write only one statement on a single line; write multiple statements on a line (poor code readability)Statement BLOCK: You can include multiple statements "{}" to wrap
Javascript: basic statements (if-else/switch/for/while/for-in/try-catch), if-elsefor-in
The basic syntax of Javascript is very similar to that of C/Java. Specifically, Javascript has a for-in statement that can be used to traverse the attributes of
In JavaScript, to perform different actions for different decisions, we can use the following conditional statements:
If statement-use this statement to execute code only if the specified condition is true
If...else Statement-executes
The basic syntax of JavaScript is very similar to C/java, and, more specifically, JavaScript has a for-in statement that can be used to traverse properties in an object. Code collated from w3school:http://www.w3school.com.cn:Code:javascript Basic
Document directory
Instance 1
Instance 2
Syntax:
Instance
Syntax:
Instance:
The Condition Statement in Javascript is used to complete the action under different conditions.Instance
If statement
How to compile an if statement.
ArticleDirectory
Javascript Introduction
How to Implement Javascript
Where to place Javascript
Javascript statements
Javascript Variables
Javascript Operators
Javascript branch statement
Javascript message box
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.