摘要: JavaScript this 关键字 面向对象语言中 this 表示当前对象的一个引用。 但在 JavaScript 中 this 不是固定不变的,它会随着执行环境的改变而改变。 在方法中,this 表示该方法所属的对象。 如果单独使用,this 表示全局对象。 在函数中,this 表示全局对象。 阅读全文
posted @ 2020-10-16 12:33 baixinL 阅读(254) 评论(0) 推荐(0)
摘要: function fun(a, b) { console.log('b:', b) return { fun: function (m) { return fun(m, a) } } } const c = fun(0); console.log('c.fun(1) = ' + c.fun(1)); 阅读全文
posted @ 2020-10-16 12:20 baixinL 阅读(95) 评论(0) 推荐(0)