Skip to content

Commit 0c6a3aa

Browse files
committed
solved wesbos#6
1 parent 2534c50 commit 0c6a3aa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,17 @@
6868
// 5. Sort the inventors by years lived
6969
const yearsLived = inventors.sort((a,b) => (a.passed-a.year) > (b.passed-b.year) ? 1 : -1);
7070
console.table(yearsLived);
71+
7172

7273
// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
7374
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
7475

76+
const category = document.querySelector(".mw-category-columns");
77+
const links = Array.from(category.querySelectorAll("a"));
78+
const de = links.map(anchor => anchor.textContent);
79+
const result = de.map(arrayItem => arrayItem.includes("de"));
80+
console.log(result);
81+
7582

7683
// 7. sort Exercise
7784
// Sort the people alphabetically by last name

0 commit comments

Comments
 (0)