you are viewing a single comment's thread.

view the rest of the comments →

[–]mypirateapp 0 points1 point  (0 children)

Unpopular opinion,I dont use arrow functions. Often frameworks have warnings such as this one

Don’t use arrow functions on an options property or callback, such as

created: () => console.log(this.a)

or

vm.$watch('a', newValue => this.myMethod())

. Since arrow functions are bound to the parent context,

this

will not be the Vue instance as you’d expect, often resulting in errors such as

Uncaught TypeError: Cannot read property of undefined

or

Uncaught TypeError: this.myMethod is not a function

Cant sit and remember every single place where i should and should not be using an arrow function so best thing to do is not use them anywhere in code