File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change 1
1
// NOTE: Make sure to use the `var` keyword for ALL variable declarations
2
2
3
- var people = [
4
- {
5
- name : "Layla" ,
6
- age : 27 ,
7
- knownLanguages : 3
8
- } , {
9
- name : "Keanu" ,
10
- age : 54 ,
11
- knownLanguages : 1
12
- } , {
13
- name : "Jasmine" ,
14
- age : 35 ,
15
- knownLanguages : 2
16
- }
17
- ]
3
+ var people = [ {
4
+ name : "Layla" ,
5
+ age : 27 ,
6
+ knownLanguages : 3
7
+ } , {
8
+ name : "Keanu" ,
9
+ age : 54 ,
10
+ knownLanguages : 1
11
+ } , {
12
+ name : "Jasmine" ,
13
+ age : 35 ,
14
+ knownLanguages : 2
15
+ } ]
18
16
19
17
// #1: Use the `map` array method to create a new array containing the names of each
20
18
// person in the `people` array. Assign the returned array to a variable
21
19
// called `peopleNames`.
22
20
// Type your solution immediately below this line:
23
-
21
+ var peopleNames = people . map ( ( people => {
22
+ return people . name ;
23
+ } ) ) ;
24
+ console . log ( peopleNames ) ;
24
25
25
26
26
27
// #2: Use the `filter` array method to create a new, filtered array containing only
27
28
// persons from the `people` array who know multiple languages. Assign the returned array
28
29
// to a variable called `polyglotPeople`.
29
- // Type your solution immediately below this line:
30
+ // Type your solution immediately below this line:
You can’t perform that action at this time.
0 commit comments