We look at the default Array.prototype.sort
behavior and discuss how you can do case insensitive string sorting.
const foo = [ 'Alpha', 'beta', 'Gamma', 'delta' ]; foo.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())); foo.forEach(x => console.log(x)); /* "Alpha" "beta" "delta" "Gamma" */