First, the basic syntax of JavaScript is defined in a pseudo-language called ECMAScript, and understanding ECMAScript's details is the key to understanding its implementation in the browser, most browsers now follow ECMAScript 3rd edition, But many have also begun to implement the 5th edition, the following total reading today:
Five of the 1.EcmaScript variables are of this type: boolean,number,object,null,undefined
2.EcmaScript does not add different data types for integers and floating-point numbers, but it automatically converts meaningless floats to integers in the background (1.0=1)
3.Object is the underlying type for all objects
4. Strict mode provides restrictions on where the language is prone to error
5.EcmaScript provides many of the same basic classes as the C language, including arithmetic (+-*/%) operators, Relationships (><=!) operator, bit operation (&^/~|>><<), etc.
6. Stream control statements, such as if, for and switch, are borrowed from other languages, but there are many different places, such as switch, which can be compared with arbitrary expressions, even variables
7. No need to specify function return value, can return any value anywhere, no return value will be undefined
There is no concept of signature in 8.EcmaScript, because a function is passed as an array of 0 or more values, so it is possible to pass parameters with arguments to access the parameters, so it cannot be overloaded.
9. Because ECMAScript uses the IEEE754 format, so there will be a lot of accuracy problems, such as: 0.1+0.2!=0.3 (do not believe you try it), it is recommended to use floating point number when not used = =, try to use >= or <=
This article is all personal reading after the summary, reproduced please declare the source
JavaScript basic syntax