Demovalue: state = > what is the syntax of state.demovalue?

Time:2021-11-18

I saw similar code in the getters of the global variable store in Vue. Is it ES6 syntax? How do you understand this code?

The whole thing is
getters: {
demoValue: state => state.demoValue,
},

If demovalue is a property of an object, why not directly
getters: {
demoValue: state.demoValue,
},

This work adoptsCC agreement, reprint must indicate the author and the link to this article