JS严格模式

如何开启严格模式?

在js中,只需要在顶部添加“use strict”,即可进入严格模式

在函数中加上“use strict”编辑指示,也可以指定函数在严格模式下执行,

function dosomething(){

"use strict"

//函数体

}

 

posted @ 2017-09-12 23:23  小安排  阅读(126)  评论(0编辑  收藏  举报