基于的es3.0 + es5.0的新增方法 使用的
es3.0 和 es5.0 产生冲突的部分
es5.0严格模式 那么es3.0和es5.0产生冲突的部分就是用es5.0
否则会用es3.0
严格模式不支持with、arguments.callee、func.caller,变量赋值前必须声明,局部this必须被赋值(Person.call(null/undefined)赋值什么就是什么),拒绝重复属性和参数
启动es5.0严格模式和全局严格模式
<script>
"use strict";//启动es5.0的严格模式
//启动了就不再兼容es3的一些不规则语法。使用全新的es5规范。
function text(){
console.log(arguments.callee)//报错
}
text()
</script>
局部严格模式(推荐使用)
<script>
function a(){
console.log(arguments.callee)//不报错
}
a()
function text(){
"use strict";
console.log(arguments.callee)//报错
}
text()
</script>