1๐
.map
returns a new array of your items, in your case you could write:
customerMap() {
const map = this.customeritems.map(e => (map[e.CustomerID] = map[e.CustomerID]))
}
Since you do not have {}
in the .map
function then implicitly it returns a new array with the transformation done to it.
If you need to filter
meaning only return a new array that fulfils a certain requirement then use the .filter
method.
๐คMichael
- [Vuejs]-Vue.js component does not show up
- [Vuejs]-How to display strings with angle brackets in Vue?
Source:stackexchange.com