Home page, we need to understand the concept of strict mode. Strict mode is a special execution mode. It fixes some language shortcomings, provides stronger error checks, and enhances security. Strict modes can be performed on some functions, such as:
function func(){
'use strict'
}
You can also perform strict mode on the entire js file, such as:
'use strict'
function func(){
}
Then we cannot use it in the following situations:
1. Width is not allowed
2. Undeclared variables are not allowed to be assigned
3. The arguments become static copy of the parameters
4. Delete parameter and function name error
5. Delete's unconfigurable attribute error
6. Object literal duplicate attribute name error
7. Octal literals are prohibited
8. Eval, arguments become keywords and cannot be used as variables or function names.
9. Eval independent scope
Generally, when function calls (not the method call of the object, nor use apply/call/bind to modify this) this points to null, not global objects.
If you use apply/call, when null or undefined is passed in, this will point to null or undefined, not the global object.
Attempt to modify the unwritable property (writable=false) and add the property Times TypeError on the non-extensible object, rather than ignore it.
arguments.caller,arguments.callee is disabled
The above summary of the strict js model (sharing) is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.