We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e51a0da commit 1a9b6c8Copy full SHA for 1a9b6c8
1 file changed
04 - Array Cardio Day 1/index-START.html
@@ -37,7 +37,7 @@
37
38
// Array.prototype.map()
39
// 2. Give us an array of the inventors first and last names
40
- const finalnamestring = inventors.map(firstandlastname)
+ const finalnamestring = inventors.map(firstandlastname);
41
function firstandlastname (x){
42
const space = ' '
43
const namestring = x.first + space + x.last;
@@ -48,6 +48,11 @@
48
49
// Array.prototype.sort()
50
// 3. Sort the inventors by birthdate, oldest to youngest
51
+ const sort = inventors.sort(oldesttoyoungest);
52
+ function oldesttoyoungest(a,b){
53
+ return a.year-b.year;
54
+ }
55
+ console.log(sort);
56
57
// Array.prototype.reduce()
58
// 4. How many years did all the inventors live all together?
0 commit comments