1. Basic grammar
- Case sensitive;
- Longest line matching principle: If a line of words can be parsed into the correct sentence, then follow the rule parsing (even if there is no semicolon), otherwise read a row.
Example: Return
A | | b
will be interpreted as return;
and return a | |
b
will be interpreted as return a | | b
- tags, for continue and break to identify loops to jump out, by default only matches the inner loop.
2. Operators
- +: Can manipulate numbers and characters; when numbers are added to characters, numbers are converted to characters; other objects attempt to invoke the valueof () or ToString () method.
- -: Operable numbers, other objects attempt to invoke the ValueOf () method.
- *: Similar to-.
- /: Similar to---returns Nan when the divisor is 0 o'clock returns infinity,0/0.
- %: and-similar; the result symbol is the same as the first number.
- + + +--: The value of the expression after the first operation, and vice versa.
- Nan or undefined participate in a relationship where the result of the comparison is false, and the inverse is true.
- Null==null returns True
- Undefined==undefined returns True
- Undefined==null returns True
- Null >=undefined return False
- && | | : If the expression on the left is sufficient to determine the result, then the expression on the right will not execute, return the expression on the left, otherwise return to the right expression, return the value of the expression, and not convert to a Boolean type.
Example: 1 && 2 | | 3 returns 2; 0 && 2 | | 3 returns 3.
- ,: x = (i = 1, k = 2) equivalent: i = 1; x = k = 2;
JavaScript language structure