String.prototype.localeCompare
とは
文字列と文字列を比較して前か後か、または同じかを示す数値を返す (= sort の比較関数の返り値として求められる挙動)
Intl.Collator に対応している環境の場合、細かなオプションが追加で使える
→ numeric
オプション!
["a1x", "a10x", "a2x", "a1y"].sort((a, b) =>
a.localeCompare(b, undefined, { numeric: true })
);