filter array in vuex 1

filter array in vuex

this.users.filter((user) => user.type.startsWith("A"));

Here is what the above code is Doing:
1. We’re using the filter() method to filter out all the users whose type starts with “A”.
2. We’re using the startsWith() method to check if the type starts with “A”.
3. We’re using the filter() method to filter out all the users whose type starts with “A”.
4. We’re using the startsWith() method to check if the type starts with “A”.

Similar Posts