[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 '???';
|
||||
}
|
||||
|
||||
const sortedBands = bands.map(removeArticles).sort().map(returnArticles);
|
||||
console.log(sortedBands);
|
||||
const bandsList = document.getElementById('bands');
|
||||
|
||||
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 JS:
|
||||
* 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">
|
||||
<head>
|
||||
|
Loading…
x
Reference in New Issue
Block a user