From faeca12c35d07f1692e4ca1cbf0e60bd311bcaab Mon Sep 17 00:00:00 2001 From: kambises Elias Date: Thu, 8 Jan 2026 21:46:29 -0600 Subject: [PATCH] finish --- 04 - Array Cardio Day 1/index-START.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 0dcfd00f40..a6b4d38d15 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -39,15 +39,24 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const inventorsXVI = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600); + console.log(inventorsXVI); + // Array.prototype.map() // 2. Give us an array of the inventors first and last names + const fullNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`); + console.log(fullNames); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + // Array.prototype.reduce() // 4. How many years did all the inventors live all together? + const aniosTotal = inventors.reduce((acumulador, inventor) => acumulador + (inventor.passed - inventor.year), 0); + console.log(aniosTotal); + // 5. Sort the inventors by years lived // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name