欢迎光临散文网 会员登陆 & 注册

老男孩linux81期

2022-11-28 21:51 作者:邱邱邱2585093180  | 我要投稿

let obj = { a: 1 }function fn(){  console.log( this )  console.log( this.a )}let newFn = fn.bind( obj )newFn() 上述中的 this 会打印出什么呢? newFn() === fn.bind( obj )() ==> this === obj ==> this.a === 1

老男孩linux81期的评论 (共 条)

分享到微博请遵守国家法律