Js declares functions in objects. What's the difference in 2?

methods: {
    functionA: function() {},
    functionB() {}
}

what"s the difference between the two above?

Mar.12,2021

the second is added by es6, that is, the first concise writing


has the same effect, without any difference.


es6 syntax is not understood, open this http://babeljs.io/repl/, put your code into the es5 to understand.


difference between es5 and es6


there is basically no difference, the latter is the syntax of es6 (es2015)

Menu