ES6-28: Strict mode

What is strict mode?

How to turn on strict mode?

  • Script to enable strict mode

  • Function turns on strict mode

What can't be used in strict mode?

  1. Undefined variables cannot be assigned directly. (Can be used in non-strict mode)

  2. Cannot delete defined variables at will in strict mode
  3. In strict mode, this in the global function no longer points to window, but undefined
  4. In strict mode, function parameters are not allowed to have the same name.

Guess you like

Origin blog.csdn.net/sinat_41696687/article/details/113930579