Skip to content

Case-sensitive js sort #7

@JB712

Description

@JB712

This is more of a comment than a problem.

The algorithm in JavaScript is case-sensitive (which means output will be ["a", "c", "B"] instead of ["a", "B", "c"].

A solution within the function could be at the very beginning of declaration:
function natcompare(a, b) { a = a?.toLowerCase(); b = b?.toLowerCase(); var ia = 0, ib = 0; ...

Or you have to call natcompare with lower-case text (natcompare(a..toLowerCase(), b.toLowerCase())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions