JavaScript严格模式

1、严格模式的使得JavaScript语法上更为严谨。

2、“use strict” 严格模式的标志。

3、严格模式下,变量必须用var显示声明后使用。

4、增加eval作用域,eval内声明的变量只能用于eval内部。

5、this关键字不能指向全局对象。

6、严格模式下无法删除变量,只有configurable设置为true时才能删除。

7、禁止扩展对象添加属性。

参考:http://www.ruanyifeng.com/blog/2013/01/javascript_strict_mode.html

  

原文地址:https://www.cnblogs.com/suiyueshentou/p/5337198.html