Skip to content

Instantly share code, notes, and snippets.

Embed
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