"Build a Simple PHP Application" was retired on March 31, 2016. You are now viewing the recommended replacement.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Array Iteration Methods!
You have completed JavaScript Array Iteration Methods!
You can combine filter() and map() to clean an array of unwanted values before transforming the leftover items. Let's work with some examples in this video.
Snippets from the Video
const userNames = ['Samir', 'Angela', 'Beatrice', 'Shaniqua', 'Marvin', 'Sean'];
// Result: [{name: 'Samir'}, {name: 'Shaniqua'}, {name:'Sean'}];
const users = [
{name: 'Samir', age: 27},
{name: 'Angela', age: 33},
{name: 'Beatrice', age: 42},
{name: 'Shaniqua', age: 30},
{name: 'Marvin', age: 23},
{name: 'Sean', age: 47}
];
// Result: ['Angela', 'Beatrice', 'Shaniqua', 'Sean'];
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up