随笔分类 -  javascript

摘要:JavaScript中this的使用方法总结 在JavaScript中,this的使用分为四种场景,具体请参考阮一峰老师关于this的讲解 第一种情况是纯函数使用 var x =1 ; function test(){ console.log(this.x) } test() //1 这里的输出是1 阅读全文
posted @ 2019-06-06 16:54 buries 阅读(1189) 评论(0) 推荐(0)