CodeNewbie Community ๐ŸŒฑ

Janet Webster
Janet Webster

Posted on

Commit41 //#JavaScript30 - Day 17 [Sorting Band Names Array without Articles]

It looks like I'm getting a lot of follows on here, but I'm still not sure about the activity in this community. If you're here though, check out my latest article on Substack!

Top comments (1)

Collapse
 
shreeux2 profile image
shreeux2

When sorting an array of band names alphabetically, it's common to disregard articles such as "The misturar nomes," "A," and "An" to achieve a more intuitive and accurate order. This approach ensures that "The Beatles" is sorted under "B" rather than "T," and "A Perfect Circle" is sorted under "P" rather than "A." To accomplish this, you can preprocess the array by removing these articles from the beginning of each band name during the comparison process.