Sort an array

Sort an array in JavaScript — with three ready prompts, from the immediate task to the lasting pattern.

3prompt heights
Open it in the interactive atlas →

3 ready prompts

Written for the moment this actually comes up.

Improve — make it easier to accept

+
Before I push this to staging, make the sorting easy for reviewers: put the comparator in a named…
Before I push this to staging, make the sorting easy for reviewers: put the comparator in a named function compareCaseInsensitive, ensure stable behavior with accented characters by using localeCompare with 'en' and sensitivity 'base', and keep the example array small so a reviewer can eyeball the order quickly.

Decide — diagnose the stuck moment

+
I merged a list and then sorted it with arr.sort(), but accented names like 'Émile' appear after…

Users report names appearing in the wrong order

I merged a list and then sorted it with arr.sort(), but accented names like 'Émile' appear after 'Zoe' unexpectedly. I don't know whether to use localeCompare or normalize the strings first. Which is the likely cause and which fix will work across browsers for English and French users?

Become — change the pattern

+
Every release we face UI complaints about ordering: case differences, accents, and numeric…

Sorting edge cases keep failing in UI reviews

Every release we face UI complaints about ordering: case differences, accents, and numeric substrings all behave inconsistently across components. I need a single sorting policy I can apply everywhere to reduce review back-and-forth. What habit or small utility function should the team adopt to make sorting predictable across locales?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.