Javascript - arrow functions this in event handler?

前端 未结 4 1140
难免孤独
难免孤独 2020-11-22 16:54

I\'m new to ES6, and can\'t quite get this to work:

$(this) returns undefined on click?

dom.videoLinks.click((e) => {
            e.         


        
4条回答
  •  遇见更好的自我
    2020-11-22 17:21

    You wouldn't.

    Changing the value of this is the primary point of using an arrow function.

    If you don't want to do that then an arrow function is the wrong tool for the job.

提交回复
热议问题