Skip to content

Commit 8c42f19

Browse files
committed
Comment out 6, add solution to 7
1 parent 4e6f1ef commit 8c42f19

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

04 - Array Cardio Day 1/index-START.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,20 @@
6868

6969
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
7070
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
71-
const category = document.querySelector('.mw-category');
72-
const links = Array.from(category.querySelectorAll('a'));
73-
const de = links
74-
.map(link => link.textContent)
75-
.filter(streetName => streetName.includes('de'));
71+
// const category = document.querySelector('.mw-category');
72+
// const links = Array.from(category.querySelectorAll('a'));
73+
// const de = links
74+
// .map(link => link.textContent)
75+
// .filter(streetName => streetName.includes('de'));
7676

7777
// 7. sort Exercise
7878
// Sort the people alphabetically by last name
79-
79+
const alpha = people.sort((lastOne, nextOne) => {
80+
const [aLast, aFirst] = lastOne.split(', ');
81+
const [bLast, bFirst] = nextOne.split(', ');
82+
return aLast > bLast ? 1 : -1;
83+
});
84+
console.log(alpha);
8085

8186
// 8. Reduce Exercise
8287
// Sum up the instances of each of these

0 commit comments

Comments
 (0)