Skip to content

Commit b2dd1c4

Browse files
committed
completed wesbos#5 using Array.prototype.sort()
1 parent b8bbc19 commit b2dd1c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
console.log('All the years that all inventors lived: ',yearsAllInventorsLived);
5858

5959
// 5. Sort the inventors by years lived
60+
inventors.sort( (a, b) => (a.passed - a.year) - (b.passed - b.year) );
61+
console.table(inventors);
62+
6063

6164
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
6265
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris

0 commit comments

Comments
 (0)