Sorting an array of bands by omitting articles
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.