Skip to content

Commit ddbeede

Browse files
hof ga-wdi-exercises#1 completed
1 parent 2135d55 commit ddbeede

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

hof.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
// NOTE: Make sure to use the `var` keyword for ALL variable declarations
22

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+
}]
1816

1917
// #1: Use the `map` array method to create a new array containing the names of each
2018
// person in the `people` array. Assign the returned array to a variable
2119
// called `peopleNames`.
2220
// Type your solution immediately below this line:
23-
21+
var peopleNames = people.map((people => {
22+
return people.name;
23+
}));
24+
console.log(peopleNames);
2425

2526

2627
// #2: Use the `filter` array method to create a new, filtered array containing only
2728
// persons from the `people` array who know multiple languages. Assign the returned array
2829
// to a variable called `polyglotPeople`.
29-
// Type your solution immediately below this line:
30+
// Type your solution immediately below this line:

0 commit comments

Comments
 (0)