1. Operators: Add, subtract, multiply, divide, and seek redundancy.
var total = (1 + 4);
var i = 100;
var temp = (i-20)/2;
Alert ("ten" +)//return1020;
Alert (ten +)//return30;
2. Post Increment/decrement operator: + +/--
var i = 10;
var a = i++; i = i + 1;
alert (a); A = 10;
var a = ++i; i = i + 1;
alert (a); A = 11;
Tip: Execute from left to right, if a = i++, then A is first equal to I, then I is added;
If a = ++i, then the ++i is executed first and then assigned to a.
3. Comparison operators:>, <, =, >= <=, = =, = =,! =,!===
Alert (> 5); Outputs true;
var i = 100;
var n = 100;
alert (i = = n); outputs true;
Alert (i! = n); outputs false;
alert (i = = N)//data type and value all want to wait.
4. Logical operators:&&, | |,!
&&: Logic and;
|| : Logical OR;
! : logical non;
var i = 8;
Alert (I < 5 && i < ten); output false;
Alert (i > | | i <); output true;
Alert (! ( 10>5)); Outputs false;
5. Program Flow control:
A. Conditional statement if:
if (> 5) {
Alert ("Hello World");
}
var i = 90;
if (i > 100) {
Alert (i + "greater than 100");
}else if (i > 80) {
Alert (i + "greater than 80");
}else {
Alert (i + "less than 100");
}
B.switch statement:
var a = B;
Switch (a) {
Case "A":
Alert ("You have selected a");
Break
Case "B":
Alert ("You have selected B"); Carried out this.
Break
Case "C":
Alert ("You have selected C");
Break
Default
Alert ("Welcome to the next time!") ");
}
JS Summary three ...