为了账号安全,请及时绑定邮箱和手机立即绑定

关于this指向

关于this指向

繁花不似锦 2018-09-07 15:15:39
var c = {    name: 'The c object',    log: function() {        this.name = 'Updated c object';        console.log(this);        var setname = function(newname) {            this.name = newname;            console.log(this);        }        setname('Updated again! The c object');        console.log(this);    }}c.log();第二个console.log为什么是指向window???
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 518 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信