1. Identifiers and keywords
Identifiers begin with letters and can contain letters, numbers, and underscores. The following reserved characters cannot be used for the identifier:
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 specific meanings in javascript, so don't use it either. JavaScript does not allow the use of reserved words to name variables or parameters. Moreover, JavaScript does not allow the use of the reserved word to move the object's property name in the object literal, or after a property access point of an attribute expression.
2. Numbers
JavaScript has only a single numeric type, and its internals are represented as 64-bit floating point numbers, the same as Java's double.
The value NaN is a numerical value, which represents an operation result that cannot produce normal results. NaN is not equal to any value, including itself. You can use the function isNaN(number) to detect NaN.
The value Infinity represents all values greater than 1.7976931348623157E+308, that is, the infinity value.
3. String
Strings are immutable. Each string change requires a new string object to be created.
The string contains Unicode 16-bit characters. There is no character type in javascript.
A string has a length attribute that can get the length of the string.
4. Statement
When the var statement defines a variable inside the function, the variable defined is the private variable of the function. Var statements that are outside or within the function do not use var to define variables (used directly, such as function(){m=3;}) are all 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.
The for …in … statement can enumerate all attribute names of an object. Usually you have to detect (variable) to determine whether this attribute name is a member of the object or found in its prototype chain.
for(var pro in Object){ if ((pro)) { ... };}
5. The following values are treated as false: false, null, undefined, empty string "", number 0, number NaN.
Identifiers begin with letters and can contain letters, numbers, and underscores. The following reserved characters cannot be used for the identifier:
Copy the codeThe code is 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 specific meanings in javascript, so don't use it either. JavaScript does not allow the use of reserved words to name variables or parameters. Moreover, JavaScript does not allow the use of the reserved word to move the object's property name in the object literal, or after a property access point of an attribute expression.
2. Numbers
JavaScript has only a single numeric type, and its internals are represented as 64-bit floating point numbers, the same as Java's double.
The value NaN is a numerical value, which represents an operation result that cannot produce normal results. NaN is not equal to any value, including itself. You can use the function isNaN(number) to detect NaN.
The value Infinity represents all values greater than 1.7976931348623157E+308, that is, the infinity value.
3. String
Strings are immutable. Each string change requires a new string object to be created.
The string contains Unicode 16-bit characters. There is no character type in javascript.
A string has a length attribute that can get the length of the string.
4. Statement
When the var statement defines a variable inside the function, the variable defined is the private variable of the function. Var statements that are outside or within the function do not use var to define variables (used directly, such as function(){m=3;}) are all 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.
The for …in … statement can enumerate all attribute names of an object. Usually you have to detect (variable) to determine whether this attribute name is a member of the object or found in its prototype chain.
for(var pro in Object){ if ((pro)) { ... };}
5. The following values are treated as false: false, null, undefined, empty string "", number 0, number NaN.