The doc says:
computed: {
// a computed getter
reversedMessage: function () {
// `this` points to the vm instance
return this.message.split('').reverse().join('')
}
}
not
computed: {
// a computed getter
reversedMessage() {
// `this` points to the vm instance
return this.message.split('').reverse().join('')
}
}
I'm just curious and totally okay not using it but Isn't it just the same? And it's 2020 and pretty safe using ES2015. What's the reason behind this?
That's because Vue 2.x supports IE 11 and we want our examples in the doc to be working as-is everywhere.
Most helpful comment
That's because Vue 2.x supports IE 11 and we want our examples in the doc to be working as-is everywhere.