Reputation: 17566
What is the difference between these two notations? For example:
...
methods: {
makeAuthorList() {
return ...
},
}
...
and
...
methods: {
makeAuthorList: function(){
return ...
},
}
...
Upvotes: 1
Views: 114
Reputation: 1222
functionally they don't have a difference, they do the exact same thing, this way:
nameOfFunction: function(){}
is just a long way to define your methods, so they added a second way to define methods which is a shorter version, just so save time
nameOfFunction() {}
Upvotes: 1
Reputation: 1904
Both are identical, the first one is just a shorter syntax for method definitions starting with ES2015. Take a look at this article from the MDN docs.
Upvotes: 1