[Javascript2] we have a list that's sorted as desired! :)
This commit is contained in:
parent
10a009f630
commit
601020f5f5
@ -48,5 +48,14 @@ function returnArticles(band) {
|
|||||||
return '???';
|
return '???';
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedBands = bands.map(removeArticles).sort().map(returnArticles);
|
const bandsList = document.getElementById('bands');
|
||||||
console.log(sortedBands);
|
|
||||||
|
bands
|
||||||
|
.map(removeArticles)
|
||||||
|
.sort()
|
||||||
|
.map(returnArticles)
|
||||||
|
.forEach((band) => {
|
||||||
|
const bandListItem = document.createElement('li');
|
||||||
|
bandListItem.textContent = band;
|
||||||
|
bandsList.appendChild(bandListItem);
|
||||||
|
});
|
||||||
|
@ -14,6 +14,8 @@ New elements:
|
|||||||
New attributes:
|
New attributes:
|
||||||
New JS:
|
New JS:
|
||||||
* JSDoc - I missed having type-based completions in VScode from TypeScript
|
* JSDoc - I missed having type-based completions in VScode from TypeScript
|
||||||
|
* Creating a DOM element - not really new, I just forgot how to and had to
|
||||||
|
double-check on W3Schools
|
||||||
-->
|
-->
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user