From 727b7f83a646f9ced46b2a7f9e348e0680a5b1ae Mon Sep 17 00:00:00 2001 From: William Date: Tue, 10 Oct 2017 23:02:50 -0400 Subject: [PATCH] mapping function added --- 04 - Array Cardio Day 1/index-START.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index b67678fc47..8e1b928a41 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -36,12 +36,13 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's - const fifteen = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600); - - console.table(fifteen); + //const fifteen = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600); + //console.table(fifteen); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + const names = inventors.map(inventor => inventor.first + ' ' + inventor.last); + console.log(names); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest