forked from ga-wdi-exercises/checkpoint-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hof.js
30 lines (26 loc) · 849 Bytes
/
hof.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// NOTE: Make sure to use the `var` keyword for ALL variable declarations
var people = [{
name: "Layla",
age: 27,
knownLanguages: 3
}, {
name: "Keanu",
age: 54,
knownLanguages: 1
}, {
name: "Jasmine",
age: 35,
knownLanguages: 2
}]
// #1: Use the `map` array method to create a new array containing the names of each
// person in the `people` array. Assign the returned array to a variable
// called `peopleNames`.
// Type your solution immediately below this line:
var peopleNames = people.map((people => {
return people.name;
}));
console.log(peopleNames);
// #2: Use the `filter` array method to create a new, filtered array containing only
// persons from the `people` array who know multiple languages. Assign the returned array
// to a variable called `polyglotPeople`.
// Type your solution immediately below this line: