javascript - 如果这是 javascript 中的保留字,为什么我仍然可以将其设置为属性?

标签 javascript

这次,我观察到了一些有趣的行为,我肯定想了解更多。

 var doStuff = function() {
  this.this = function() {
    console.log("I'm the other this"); 
  }

  this.this(); //Is this legal to be used ?

};


doStuff.call(null);

输出

I'm the other this

最佳答案

关于javascript - 如果这是 javascript 中的保留字,为什么我仍然可以将其设置为属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31765627/

相关文章:

javascript - Node.js - 在循环中读写数千/数百万个 JSON 文件

javascript - 操纵 :before pseudoclass's background with jQuery

javascript - Phonegap Android 项目适用于模拟器,不适用于实际手机

javascript - 更改颜色代码不起作用

javascript - 如何通过 javascript 从 silverlight 媒体播放器 (player.xap) 获取播放状态?

javascript - 浏览器中的 CSS 错误 : 'Unknown property name' when using pseudo :after

javascript - JQuery,剥离所有标签,包装新标签并克隆和附加

javascript - jQuery text() 和换行符

javascript - Angular js 网站刚刚停止工作

javascript - 使用变量调用数据集d3.js中的数据列