1. Conditional statements
if (conditional statement)
{EXECUTE statement 1}
Else
{EXECUTE Statement 2}
2. Looping statements
For (variable, judge, variable increment/subtract) {EXECUTE statement}
For: The variable is executed after the judgment statement is incremented, and the condition is not executed after the
3.while and Do While
while (expression 1) {expression 2;} expression 3;
While the expression 1 is judged, conforms to the conditional execution Expression 2, does not conform to the conditional execution Expression 3
do{expression 1;}while (expression 2); expression 3;
Whether or not the condition is met, the expression 1 is executed, the expression 2 is judged, and the expression 3 is executed, and the loop can execute at least once
4. Data type
Data types are divided into raw data and reference data.
The original data is divided into number, string, Boolean, null, undefined, with typeof to query the data type, except that null returns an object, the rest of the original data is the return of their own data type.
Reference data types are classified as object, array, function, NaN. When a data type query is made with TypeOf, object, array returns object,function returns Function,nan returns number.
5.parseInt (value) converts the argument to an integer.
6. Output mode: 1) alert (""); pop-up box shows "" Inside content
2) Console.log (""), Background display "" Inside content
3) document.write (""); Display the contents of "" in the Web page
JS commonly used in the loop and other