Sorting an array of bands by omitting articles I've written a simple script that takes an array, sorts it (by omitting the articles) and displays it on a list. But I feel like this code is really huge, bulky and messy and could be simplified!

What I'm asking for:


What would be a more efficient way to do what I'm trying to do?
How would I make this code more neat (or compact in other words).
Could any new JS features ease up my work?




&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;

&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Sort Without Articles&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

    &lt;style&gt;
        body {
            margin: 0;
            font-family: sans-serif;
            background: url("https://source.unsplash.com/nDqA4d5NL0k/2000x2000");
            background-size: cover;
            display: flex;
            align-items: center;
            min-height: 100vh;
        }
        
        #bands {
            list-style: inside square;
            font-size: 20px;
            background: white;
            width: 500px;
            margin: auto;
            padding: 0;
            box-shadow: 0 0 0 20px rgba(0, 0, 0, 0.05);
        }
        
        #bands li {
            border-bottom: 1px solid #efefef;
            padding: 20px;
        }
        
        #bands li:last-child {
            border-bottom: 0;
        }
        
        a {
            color: #ffc600;
            text-decoration: none;
        }
    &lt;/style&gt;

    &lt;ul id="bands"&gt;&lt;/ul&gt;

    &lt;script&gt;
        const bandsList = document.querySelector('#bands');

        const bands = ['The Plot in You', 'The Devil Wears Prada', 'Pierce the Veil', 'Norma Jean', 'The Bled', 'Say Anything', 'The Midway State', 'We Came as Romans', 'Counterparts', 'Oh, Sleeper', 'A Skylit Drive', 'Anywhere But Here', 'An Old Dog'];

        const articles = ['The', 'An', 'A'];

        const sorted = bands.sort((previous, next) =&gt; {
            previous = previous.split(' ');
            next = next.split(' ');

            if (articles.includes(previous[0])) {
                previous = previous.splice(1, previous.length).join(' ');
            } else {
                previous = previous.join(' ');
            }


            if (articles.includes(next[0])) {
                next = next.splice(1, previous.length).join(' ');
            } else {
                next = next.join(' ');
            }

            if (previous &lt; next) return -1;
            if (previous &gt; next) return 1;

            return 0;
        });

        const markup = sorted.reduce((markup, name) =&gt; {
            return `
              ${markup}
              &lt;li&gt;${name}&lt;/li&gt;
            `;
        }, '');

        bandsList.innerHTML = markup;
    &lt;/script&gt;

&lt;/body&gt;

&lt;/html&gt;
I would consider using a regex instead:

const articlesRegex = /^(The|An|A)\s+/i;

const sorted = bands.sort((previous, next) =&gt; {
  previous = previous.replace(articlesRegex,'');
  next = next.replace(articlesRegex,'');


You should also return 0 when the items are equal.