1. 作為對(duì)象的方法調(diào)用
obj.fn() // 此時(shí)fn中的 this 指向 obj
2. 直接調(diào)用
fn() // 此時(shí)可以看做是 undefined.fn()
PS:嚴(yán)格模式下this的值為 undefined骄呼,非嚴(yán)格模式下的this會(huì)被賦值為 window
3. 構(gòu)造函數(shù)中的 this
var obj = new fn() // 此時(shí)fn中的 this 指向新建對(duì)象 obj
4. call轨蛤,apply瑰枫,bind 可為函數(shù)指定自定義的 this
fn.call( MyDefineObj ) // 此時(shí)fn中的 this 指向 MyDefineObj