老師好,老師提到箭頭函數中的this 會變, 我自己也試過的確變了,但是能簡單解釋下爲什麽會變嗎?沒有obj的情況下,箭頭中的this是指向哪裏???
来源:8-5 benchmark

Vali_Lucifer3477978
2017-10-24
1)
$('.page').on('onLoad', function(){
console.log( $(this).attr('id'), '==>', 'onLoad');
$(this).find('.component').trigger('onLoad');
});
2)
$('.page').on('onLoad', ()=》{
console.log( $(this).attr('id'), '==>', 'onLoad');
$(this).find('.component').trigger('onLoad');
});
写回答
1回答
-
http://www.cnblogs.com/TomXu/archive/2012/01/17/2310479.html 看看这个,相信会对你有些帮助
012017-10-30
相似问题