Összehasonlítás, eredménye -1, 0, 1.
localeCompare(compareString) localeCompare(compareString, locales) localeCompare(compareString, locales, options)
const text1 = 'red apple' const text2 = 'red' console.log(text1.localeCompare('red pear')) // Expected output: -1 console.log(text2.localeCompare('red')) // Expected output: 0