2👍
✅
You should use computed property; Here’s the code:
data() {
return {
myValues: [1,2,3,4],
};
},
computed: {
newValues() {
const newValues = []
this.myValues.forEach(v => newValues.push(v + 1));
return newValues;
},
},
Source:stackexchange.com