1

In the Vue documentation, the syntax myFunc: function(){...} is often used, for computed or methods. In these places, myFunc(){...} also works. Is there any difference? Is there any reason not to use the simpler syntax?

bbsimonbb
  • 24,062
  • 11
  • 66
  • 99

1 Answers1

0

The both do the same thing. The difference is the shorter one is ES6 syntax which needs to be transpiled into ES5 in order to work in older browsers.

Scriptonomy
  • 3,869
  • 1
  • 12
  • 22