在非严格模式下,函数的调用上下文(this的值)是全局对象。在严格模式下,调用上下文是undefined。

“this”可以用来判断当前是否为严格模式:

var strict = (function(){

  return !this;

}());

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案