|
20 | 20 | { first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 },
|
21 | 21 | { first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 },
|
22 | 22 | { first: 'Max', last: 'Planck', year: 1858, passed: 1947 },
|
23 |
| - { first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 }, |
24 |
| - { first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 }, |
25 |
| - { first: 'Sarah E.', last: 'Goode', year: 1855, passed: 1905 }, |
26 |
| - { first: 'Lise', last: 'Meitner', year: 1878, passed: 1968 }, |
27 |
| - { first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 } |
28 | 23 | ];
|
29 | 24 |
|
30 | 25 | const people = [
|
|
69 | 64 |
|
70 | 65 | // 5. Sort the inventors by years lived
|
71 | 66 | const oldest = inventors.sort(function(a, b) {
|
72 |
| - const lastInventor = a.passed - a.year; |
73 |
| - const nextInventor = b.passed - b.year; |
74 |
| - return lastInventor > nextInventor ? -1 : 1; |
| 67 | + const lastGuy = a.passed - a.year; |
| 68 | + const nextGuy = b.passed - b.year; |
| 69 | + return lastGuy > nextGuy ? -1 : 1; |
75 | 70 | });
|
76 | 71 | console.table(oldest);
|
77 | 72 |
|
|
0 commit comments