We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that String.prototype.localeCompare does not correctly take into account the numeric option when sorting.
String.prototype.localeCompare
numeric
Example snippet:
const items = ['1', '2', '1a', '10b', '10a', '10']; const sortedItems = items.sort((a, b) => a.localeCompare(b, 'en', {numeric: true})); console.log(sortedItems);
Node and the browser log out [ '1', '1a', '2', '10', '10a', '10b' ]. Whereas Deno logs out [ "1", "10", "10a", "10b", "1a", "2" ].
[ '1', '1a', '2', '10', '10a', '10b' ]
[ "1", "10", "10a", "10b", "1a", "2" ]
Deno Repl Node Repl
The text was updated successfully, but these errors were encountered:
Sorry this seems to be a duplicate of #1968
Sorry, something went wrong.
No branches or pull requests
It seems that
String.prototype.localeCompare
does not correctly take into account thenumeric
option when sorting.Example snippet:
Node and the browser log out
[ '1', '1a', '2', '10', '10a', '10b' ]
.Whereas Deno logs out
[ "1", "10", "10a", "10b", "1a", "2" ]
.Deno Repl
Node Repl
The text was updated successfully, but these errors were encountered: