As we've mentioned in the formatting filters example, AngularJS lets us format data or manipulate array collections through filters. In this example we'll take a look at the array filters for data manipulation.
We can decide to act only on specific object properties to filter the items in the array and that's what we do in point 2. Here we filter only lastName and age for every object searching for a substring only in those fields. We specify the substrings to search individually for each one of the two fields and both the substrings must match for an object to be returned.
In point 3 we see an alternative to point 2. Here we use a special dollar ($) symbol to say: search for the objProp2AgeFilter substring only in the age field of an array item and search for the objProp2NameFilter substring in all the fields (age included).
In point 4 we show how we can store the filtered array in a variable and use it somewhere else to have information on it. Here filteredPeople is the variable where the people array will be stored after applying the filter on it, so filteredPeople will contain only the items matching the filter conditions. This is very convenient for example in case we want to retrieve the length of the filtered array as we see at the end of the point where we write the filteredPeople.length expression.