One Pager Cheat Sheet
- Filtering an array of
objects
in JavaScript requires understanding of the distinction betweenarrays
as a collection of similar items andobjects
as a collection of unique characteristics of a single thing. - Using an array of objects is an ideal way to represent a group of items that have multiple unique characteristics, such as a
group of users
in an app, represented asJavaScript objects
. - We can filter an array of objects to find a specific set of members based on a certain property that makes them different from the rest of the array.
- We used JavaScript's
filter()
method tosplit
the sourcepeople
array into two distinct subsets based on thecountry
property and the value of'United States'
.