JS严格模式时间:2023-03-09 18:04:16 如何开启严格模式? 在js中,只需要在顶部添加“use strict”,即可进入严格模式 在函数中加上“use strict”编辑指示,也可以指定函数在严格模式下执行, 如 function dosomething(){ "use strict" //函数体 }