Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d933bfc

Browse files
committed
finish wesbos#7
1 parent 1418789 commit d933bfc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,22 @@
142142

143143
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
144144
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
145-
const category = document.querySelector(".mw-category");
146-
const links = Array.from(category.querySelectorAll("a"));
147-
const deStreetNames = links
148-
.map((link) => link.textContent)
149-
.filter((street) => street.includes(" de"));
145+
// const category = document.querySelector(".mw-category");
146+
// const links = Array.from(category.querySelectorAll("a"));
147+
// const deStreetNames = links
148+
// .map((link) => link.textContent)
149+
// .filter((street) => street.includes(" de"));
150150

151-
console.log(deStreetNames);
151+
// console.log(deStreetNames);
152152

153153
// 7. sort Exercise
154154
// Sort the people alphabetically by last name
155+
const alphaSort = people.sort((a, b) => {
156+
const [aLast, aFirst] = a.split(", ");
157+
const [bLast, bFirst] = b.split(", ");
158+
return aFirst > bFirst ? 1 : -1;
159+
});
160+
console.log(alphaSort);
155161

156162
// 8. Reduce Exercise
157163
// Sum up the instances of each of these

0 commit comments

Comments
 (0)