- 链接地址:https://blog.csdn.net/qq_43316970/article/details/123982793
- 链接标题:JavaScript this关键字的理解_js this关键字的理解_zhihao_Guo的博客-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4150
JavaScript this 关键字的理解仅供个人学习做笔记使用,大佬轻喷直接输出this指向全局对象console.log(this)全局函数其实是window(全局对象)的方法function fun { console.log(this);}fun();//等价 window.fun()3.this放在方法中,this 指向调用这个方法的对象let cat = { name="喵喵", sayName(){ console.log("我是"+this.nam_js this关键字的理解
版权声明:本文发布于特牛生活网 内容均来源于互联网 如有侵权联系删除