// "use strict"
/*functionfactorial(num){
if(num<=1){
return1;
}else{
return num*arguments.callee(num-1);
}
}
console.log(factorial(5));//'caller', 'callee', and'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them*/
//严格模式下 if语句不能创建函数 预编译不会提到if语句外
/*"use strict"if(true){
function dosomething(){
console.log("好像没出错");
}
}else{
//写完
}
dosomething();//ReferenceError: dosomething is notdefined*/
//eval(),它将不再包含上下文中创建函数或者变量;
/*"use strict"functiondosomething(){
eval("var x=10");
console.log(x);//: x is not defined
}
dosomething()*/
//eval()在严格模式下只有在被求值的特殊作用域下有效,随后被销毁
/*"use strict"
var result=eval("var x=10,y=11;x+y");
alert(result);//21*/