We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2dd1c4 commit f5594daCopy full SHA for f5594da
04 - Array Cardio Day 1/index-START.html
@@ -63,10 +63,21 @@
63
64
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
65
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
66
-
+ //skipping #6... hard one...
67
68
// 7. sort Exercise
69
// Sort the people alphabetically by last name
70
+ inventors.sort( (a, b) => {
71
+ if (a.last < b.last) {
72
+ return -1;
73
+ } else if (a.last > b.last) {
74
+ return 1;
75
+ } else {
76
+ return 0;
77
+ }
78
+ } );
79
+ console.log('sorting people alphabetically by last name');
80
+ console.table(inventors);
81
82
// 8. Reduce Exercise
83
// Sum up the instances of each of these
0 commit comments