The concept of the package or namespace should not be unfamiliar to the students who have used Java and. NET, and because of this concept, the simplicity and readability of the code is guaranteed. I do not know how JavaScript design at the beginning of how to locate the With statement, the individual feel that they have a certain degree of similarity. Such as:
Copy Code code as follows:
Appl
Core tips: JavaScript Classic statement and its basic application
Open
Save As
Property
Print
Page Setup
Refresh
Import Favorites
Export Favorites
Add to Favorites
Organize Favorite Folders
View Original file
Language Settings
Forward
Back
Manipulating the database with Javascript
The application
UGLIFYJS is a tool for compressing and beautifying JavaScript, and in its documentation, I've seen several ways to optimize if statements. Although I have not used it to do some experimental testing, but from here I can see that it does make JS a landscaping work. Perhaps some people think that if statement is so simple, can optimize to what extent? But looking at the following ways, you may change your min
Use curly braces on multiple lines of statement blocksBADIF (test) return False;//goodif (test) return False;//goodif (test) {return false;} Bad function () {return false;};/ /goodfunction () {return false;}For multi-line statement blocks that use if and else, place the else and if statement block left curly braces on the same line.BADIF (test) {A (); B ();} Else
The example in this article describes the use of a for in statement in JavaScript. Share to everyone for your reference. Specifically as follows:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23-24
I hope this article will help you with your JavaScript programming.
Grammar
Let variable1 = value1
ParametersVariable1The name of the variable to declare.Value1The initial value assigned to the variable.
Noteuse the LET statement to declare a variable whose scope is limited to the block in which it is declared. You can assign a value to a variable when you declare it, or you can assign a value to a variable in a script later.Variables that use let declarations cannot be used before the declaration, or t
If we have embedded in the HTML as JS block of code (in fact, JS does not have a block of code meaning, if really want to think of code block that also should be divided by function block), Here is the JS Code execution order: Here reproduced JS execution sequence summary, please refer to http://www.3lian.com/edu/2014/04-07/139469.html Step 1. Read in the first block of code , in the order in which they are declared in HTML. Step 2. Do grammar analysis, parsing the basic syntax format, error
1:switchKey fields: Switch (n), case, break, defaultSwitch (n): n is an expression or a variable that is used to match the various cases below, such as: At this point the day output is a number 5. Matched to case 5, the corresponding value is output.Default: Code that executes when the case item is not matched toHow it works: first set an expression n (usually a variable). The value of the subsequent expression is compared to the value of each case in the structure. If there is a match, the code
If is one of the common syntax, the format is as follows
if (Coditon) statement1 (Else Statement2)
Where Coditon can be any expression, not even a true Boolean value, because JavaScript converts it automatically to a Boolean value.
Executes statement1 if the condition execution evaluates to TRUE, and executes the result Statment2 if the condition is false (else is not required if statement2 exists)
Each conditional
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.