Last active
December 24, 2015 11:49
-
-
Save silianlinyi/6793676 to your computer and use it in GitHub Desktop.
在严格模式中,调用的函数(不是方法)中的一个this值是undefined。(在非严格模式中,调用的函数中的this值总是全局对象)。可以利用这种特性来
判断JavaScript实现是否支持严格模式。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hasStrictMode = (function() { | |
"use strict"; | |
return this === undefined; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment