1. Identifiers and Keywords
Identifiers begin with a letter and can contain letters, numbers, and underscores. Identifiers cannot use the following reserved characters:
Copy Code code as follows:
Abstract, Boolean, Break,byte,case,catch,char,class,const,debugger,default,delete,do,double,else,enum,export, Extends,false,final,finally,float,for,function,goto,if,implements,import,in,instanceof,int,interface,long, Native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw, Throws,transient,true,try,typeof,var,volatile,void,while,with
In addition, Undefined,nan,infinity has a specific meaning in JavaScript, so don't use it. JavaScript does not allow reserved words to be used to name variables or parameters. Also, JavaScript does not allow you to use the property name of the reserved word-bit object in object literals, or after a property accesses the expression's point number.
2. Digital
JavaScript has only a single numeric type, and its interior is represented as a 64-bit floating-point number, like a double in Java.
A value Nan is a numeric value that represents a result of an operation that does not produce a normal result, Nan is not equal to any value, including itself, and you can detect Nan with a function isNaN (number).
The value infinity represents all values greater than 1.7976931348623157E+308, that is, an infinity value.
3. String
The string is immutable. A new string object is created each time the string changes.
The string contains Unicode 16-bit characters. There are no character types in JavaScript.
The string has a length property that can be used to get the lengths of the string.
4. Statement
When the VAR statement defines a variable inside a function, the defined variable is the private variable of the function. VAR statement outside the function or within a function without the Var-defined variable (directly used, such as: function () {m=3;} ) are global variables.
A code block in JavaScript does not create a new scope, so the variable should be defined at the top of the function, not in the code block.
For ... in ..... Statement to enumerate all the property names of an object. Usually you have to check Object.hasownproperty (varible) to determine whether the property name is a member of the object or is found from its prototype chain.
For (Var pro in Object) {if (Object.hasownproperty (pro)) {...};}
5. The following values are treated as false (false): false,null,undefined, empty string "", number 0, number Nan.