In this assignment, we use the JavaScript reduce array method to solve multiple exercises based on Game of Thrones houses. We start by counting all people across houses, then build arrays of people per house, extract all names, and filter names containing 's' or surnames starting with 's'. The video demonstrates how reduce can aggregate data from an array of objects.
Alternative approaches using chaining map and filter are also shown, highlighting the flexibility of JavaScript array methods. This is a practical exercise for beginners to strengthen their understanding of reduce and functional programming patterns.
Timeline
0:00 Exercise Overview
0:47 Using Accumulator in Reduce
1:32 Accessing House Data
2:17 Mapping People Array
3:04 Viewing House People
3:51 Filtering People
4:42 Concatenating Results
5:27 Adding Keys to Accumulator
Explore more at AltCampus: https://altcampus.com