1. the difference between a statement statement and an expression is that the former is primarily intended to perform some sort of operation, and generally does not require a return value, while the latter is intended to return a value. A statement can contain more than one expression.
2. Variable attention variable elevation console.log (a); var a = 1;
3. Conditional Statement 3.1 If structure in order to avoid confusing "assignment expressions" (=) with the "Strict equality operator" (= = =) or "equality operator" (= =), some developers are accustomed to writing constants on the left side of the operator, so that if the equality operator is inadvertently written as an assignment operator, You will get an error because the constants cannot be assigned. if (x = 2) {//Do not error if (2 = x) {//Error 3.1 Switch structure switch (fruit) {case "banana"://... break; Case "Apple"://... break; Default://...} Note that the expression after the switch statement is the one that follows the case statement, and when you compare the run result, the strict equality operator (= = =) instead of the equality operator (= =), which means that no type conversion occurs when the comparison is made.
js-20170605-Basic Syntax