Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 191e41f

Browse files
author
William Coleman
authored
Merge pull request #8 from wcski/array-cardio-1
mapping function added
2 parents e97e0b4 + 727b7f8 commit 191e41f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

04 - Array Cardio Day 1/index-START.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636

3737
// Array.prototype.filter()
3838
// 1. Filter the list of inventors for those who were born in the 1500's
39-
const fifteen = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600);
40-
41-
console.table(fifteen);
39+
//const fifteen = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600);
40+
//console.table(fifteen);
4241

4342
// Array.prototype.map()
4443
// 2. Give us an array of the inventors' first and last names
44+
const names = inventors.map(inventor => inventor.first + ' ' + inventor.last);
45+
console.log(names);
4546

4647
// Array.prototype.sort()
4748
// 3. Sort the inventors by birthdate, oldest to youngest

0 commit comments

Comments
 (0)