How would I go about filtering an array based on specific properties within it?
For example, if I only wanted the objects with the season
property in them.
[
{
population: 121321313,
location: 'American city in the East',
},
{
season: 'winter',
population: 54646546,
location: 'Canadian city in the East',
},
{
population: 6546467,
location: 'American city in the West',
},
{
season: 'fall',
population: 145313,
location: 'American city in the South',
},
{
population: 12673,
location: 'Canadian city2 in the East',
},
{
population: 141313,
location: 'Canadian city in the South',
},
{
season: 'fall',
population: 1264473,
location: 'Canadian city4 in the East',
},
{
population: 12673,
location: 'Canadian city6 in the South',
},
];