Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2021 12:13
What would you like to do?
Compare texts using another locale in JavaScript
const comparer = new Intl.Collator('ru', { numeric: true }).compare;
console.log(comparer('ф', 'в')); //returns -1, 0, 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment