1. Everything in JS (variables, function names, operators, etc.) is case-sensitive. --true is a Boolean value, and true is just an identifier.
2. The JS statement ends with a semicolon, but is not required for the reason:
A. No semicolon at the end can sometimes cause compression errors.
B. A semicolon, in some cases, makes it easier for the parser to improve the performance of the code.
3. Different ECMAScript versions have different definitions for keywords and reserved words, but it is best to never use any keywords or reserved words in the JS code in order to be compatible with future versions of ECMAScript.
4. The ECMAScript variable is loosely typed, that is, a variable has no specific type restrictions and can hold any type of data. A variable that has not been initialized will hold a special value of--undefined.
5. The variable defined by the var operator becomes a local variable in the scope that defines the variable. If the variable defined by VAR is not within any statement block, it is a global variable. It is also possible to define global variables directly in the block of statements by omitting Var, but this practice is not recommended, it is easier to cause confusion and is not conducive to maintenance.
6. There are 5 simple data types (basic types) in ECMAScript: Undefined, Null, Boolean, number, String. There is also a complex data type: Object.
7. typeof is used to detect the data type of a given variable.
8. Execution of typeof on uninitialized or undeclared variables will return undefined. The undefined value is actually derived from a null value. therefore null = = undefined.
9. A Boolean value of true does not necessarily equal 1, and false does not necessarily equal 0. The values that are equivalent to False are: false, "", 0, NaN, null, undefined, and the rest of the values are equivalent to true.
10. The highest precision of a floating-point value is 17 decimal places, but it is far less accurate than an integer in arithmetic calculations, so never test a particular floating-point value. For example a=0.1,b=0.2, but a+b! = 0.3.
Each. Nan is not equal to any value, including the Nan itself.
JavaScript Learning Note III: Basic Concepts (1)