javaScript and ES6 strict mode

Strict mode is the use of "use strict" in the scripting language, automatically using strict mode in ES5,6 mainly has the following limitations:

  1. Variables must be declared before use
  2. Function parameters can not appear with the same name attribute, otherwise an error
  3. You can not use the with statement
  4. Can not assign read-only attribute, otherwise an error
  5. You can not delete the property can not be deleted, otherwise an error
  6. You can not use the prefix 0 indicates octal, otherwise an error
  7. You can not use delete delete variables, such as ABC = var [. 1];  delete given ABC (not using strict mode returns to false) , the deleted property can delete abc [0]
  8. eval it will not be introduced into the enclosing scope variables
  9. eval and arguments can not be reassigned
  10. Function arguments do not automatically change the reaction parameters
  11. You can not use arguments.callee
  12. You can not use arguments.caller
  13. Return undefined when the ban this point to the global object, use this
  14. You can not use fn.caller and fn.arguments get the function call stack
  15. An increase of reserved words (protected, static, interface)

Guess you like

Origin www.cnblogs.com/zzw-847776943/p/12456694.html