We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d05f288 commit eed505bCopy full SHA for eed505b
04 - Array Cardio Day 1/index-START.html
@@ -53,7 +53,17 @@
53
console.log(fullNames)
54
// Array.prototype.sort()
55
// 3. Sort the inventors by birthdate, oldest to youngest
56
- const ordered = inventors.sort()
+ // const ordered = inventors.sort(function(a,b){
57
+ // if(a.year > b.year) {
58
+ // return 1;
59
+ // }else{
60
+ // return -1;
61
+ // }
62
+ // })
63
+
64
+ const ordered = inventors.sort((a,b) => a.year > b.year ? 1 : -1)
65
66
+ console.table(ordered)
67
// Array.prototype.reduce()
68
// 4. How many years did all the inventors live all together?
69
0 commit comments