KISS albums

by trentHarlem

HTML

<p id='albums'>Kiss, Hotter than Hell, Dressed to Kill, Alive!, Destroyer, Rock and Roll Over, Love Gun, Alive II, Double Platinum, Dynasty, Unmasked, The Elder, Creatures of the Night</p>

JavaScript

//default sort is by Release Date(needs confirm)
const albums=document.getElementById('albums')
const albumsContent = albums.innerHTML
//let albumsArray = [...albumsContent.split(', ')]
//let lowerCaseArray = Array.from(albumsContent.toLowerCase().split(', '))
let albumsArray = Array.from(albumsContent.split(', '))


let sortedArray = albumsArray.sort()
//const sortedArray = (x) => x.sort()
//console.log(sortedArray(albumsArray))


//console.log(albumsArray) 
console.log(sortedArray[0])
console.log(albumsArray[0])