Skip to content

Commit d332e64

Browse files
committed
� Chain of filter().map(), #14
1 parent 1a9392e commit d332e64

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

All Lessons/filterExample3.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// find the first name of all the people whose age is less than 30
2+
const users = [
3+
{ firstName: "Riyaz", lastName: "Ahamad", age: 23},
4+
{ firstName: "Donald", lastName: "Trump", age: 76},
5+
{ firstName: "Cristiano", lastName: "Ronaldo", age: 35},
6+
{ firstName: "Albert", lastName: "Einstein", age: 23},
7+
];
8+
9+
const output = users.filter( x => x.age < 30).map(x => x.firstName );
10+
11+
console.log(output);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy