We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 851d588 commit ef65a58Copy full SHA for ef65a58
04 - Array Cardio Day 1/index-START.html
@@ -59,7 +59,12 @@
59
console.log(totalYears);
60
61
// 5. Sort the inventors by years lived
62
-
+ const oldest = inventors.sort(function(a, b) {
63
+ const lastInventor = a.passed - a.year;
64
+ const nextInventor = b.passed - b.year;
65
+ return lastInventor > nextInventor ? -1 : 1;
66
+ });
67
+ console.table(oldest);
68
69
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
70
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
0 commit comments