[Vuejs]-Find object values in array Vue Javascript Vuex?

3👍

To find all people with a certain last name, you should use filter as it’s very similar to find only it returns multiple items in an array.

const found = people.filter(({ Last_Name }) => person.Last_Name == Last_Name);

Note that to check if no people have been found you need to check if length == 0 because an empty array is still truthy.

Leave a comment