Skip to content

locale compare

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Compare two strings in current locale.

const localeCompare = require('@extra-string/locale-compare');
// localeCompare(<string-1>, <string-2>)

localeCompare('abra', 'bulbasaur');
// -1
localeCompare('bulbasaur', 'bulbasaur');
// 0
localeCompare('charmeleon', 'bulbasaur');
// 1

extra-string

Clone this wiki locally