Follow

who needs to check what EcmaScript mandates Array.protoype.sort() to be stable? Not me:

arr.sort((a,b) => (a.order - b.order) || a.name.localeCompare(b.name))

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.