When defining methods in my Vue app, I have chosen to use the following format:
methods: {
myMethod(arg) {
// do something here
}
}
Although it is more common to see it written like this:
methods: {
myMethod: function (arg) {
// do something here
}
}
The way I prefer may appear cleaner to me, and both methods work fine. However, could I potentially be making a grave JavaScript mistake? Could this decision come back to haunt me in the future?