Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Completes the sixth exercise of Exercise 4
  • Loading branch information
dustinleer committed Oct 12, 2018
commit fb80fd05a486f473131558cbadf4939e69982d7e
1 change: 1 addition & 0 deletions 04 - Array Cardio Day 1/index-START.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</head>
<body>
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
<p>Use this <a href="https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris" target="_blank">LINK</a> for Paris Array Exercise.</p>
<script type="text/javascript" src="scripts.js"></script>
</body>
</html>
31 changes: 30 additions & 1 deletion 04 - Array Cardio Day 1/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,36 @@ const oldest = inventors.sort(function(a, b) {
console.table(oldest);

// 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name
// https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
/*******************************************************************
* THIS ONLY WORKS IN THE CONSOLE ON THE WIKI PAGE
* https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris
*******************************************************************/
//const category = document.querySelector('.mw-category');
/***************************************
* ✌️ Two ways to convert to an array
***************************************/
/* ☝️ FIRST - use Array.from - more readable */
//const links = Array.from(category.querySelectorAll('a'));

/* ✌️ SECOND - ES6 dot spread */
// const links = [...(category.querySelectorAll('a')];

// const de = links
// .map(link => link.textContent);
// .filter(streetName => streetName.includes('de'));
/****************************************************************
* FINISHED CODE TO USE IN THE CONSOLE,
* WILL NEED TO TYPE IN YOUR CONST FOR A RETURN VALUE
*****************************************************************/
/*
const category = document.querySelector('.mw-category');
const links = Array.from(category.querySelectorAll('a'));

const de = links
.map(link => link.textContent)
.filter(streetName => streetName.includes('de'));
*/



// 7. sort Exercise
Expand Down
7 changes: 7 additions & 0 deletions 04 - Array Cardio Day 1/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ body {
font-weight: 100;
font-size: 50px;
}

a {
color: white;
font-weight: bold;
text-decoration: none;
border-bottom: 10px solid white;
}