the codeartist — programmer and engineer based in Berlin · May 12, 2024
Sort list of strings in Javascript
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
users.sort((a, b) => a.firstname.localeCompare(b.firstname)) or reversed order: users.sort((a, b) => a.firstname.localeCompare(b.firstname) * -1)
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.