摘要: var obj = { id: "awesome", cool: () => { // 普通函数this是在运行时确定的,而箭头函数绑定了上层函数或window的this console.log(this.id); } }; var id = "not awesome"; obj.cool(); / 阅读全文
posted @ 2023-04-20 16:16 黄燃 阅读(22) 评论(0) 推荐(0)