作者:刘志祥 时间:2017.11.10 参考:阮一峰的官方网站 this 是javaScript中的一个关键字,只能在函数内使用.随着场合的不同,this的值会发生变化. 1. 单纯的全局函数调用,此时this指向window对象 function test1(){ this.x = 1; alert(this.x); } test2(); var x = 1; function test2(){ alert(this.x); } test2(); var x = 1; function te…