[Vuejs]-How can I use map filters?

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

Leave a comment