JavaScript rigorous mode (strict mode) is run under strict conditions.
Use strict
In strict mode you cannot use the variable that is not declared
The "Use strict" directive only runs at the beginning of a script or function.
The significance of using strict mode:
To eliminate some of the unsafe code operation, to ensure the security of code operation;
Improve compiler efficiency, increase running speed;
Pave the future for new versions of JavaScript.
Limitations of Strict mode
Non-declared variables are not allowed:
Deleting a variable or object is not allowed.
Deleting functions is not allowed.
Variable names are not allowed:
Octal is not allowed:
Escape characters are not allowed:
You are not allowed to assign a value to a read-only property:
A property that is read with a getter method is not allowed to be assigned a value
Deleting a property that does not allow deletion is not allowed:
The variable name cannot use the "eval" string:
Variable names cannot use the "arguments" string:
The following statements are not allowed:
"Use strict";
With (Math) {x = cos (2)};//ErrorFor Some security reasons, variables created at the scope eval () cannot be called:
The four strict mode of JS preparing for spring recruit