Js strict mode Summary (SHARE), js summary and sharing
On the homepage, we need to understand the concept of strict mode. Strict mode is a special execution mode, which fixes some language limitations, provides stronger error checks, and enhances the security of the disease. Some functions can be executed in strict mode, such:
Function func (){
'Use strict'
}
You can also perform strict mode on the entire js file, such:
'Use strict'
Function func (){
}
We cannot use this function in the following scenarios:
1. width is not allowed.
2. unspecified variables cannot be assigned values.
3. Change arguments to a static copy of the parameter.
4. An error is reported for the delete parameter and function name.
5. An error is returned when the delete attribute cannot be configured.
6. An error is reported when the attribute name of the object is repeated in literal form.
7. Prohibit the octal literal
8. Change eval and arguments to keywords. They cannot be used as variables or function names.
9. Independent eval Scope
This points to null, not a global object, when calling a function (not an object's method call, or modifying this without applying, call, or bind.
If you use apply/call, when null or undefined is passed in, this will point to null or undefined, not a global object.
If you try to modify the non-writable attribute (writable = false), a TypeError is returned when you add the attribute to an object that cannot be extended, rather than ignoring it.
Arguments. caller, arguments. callee is disabled
The above js strict mode Summary (SHARE) is all the content shared by Alibaba Cloud xiaobian. I hope you can give us a reference and support the help house.