DIFF.BLOG
New Following Discover Jobs
More
Top Writers Suggest a blog Upvotes plugin
Report bug Contact About
Sign up
Topics
Follow your own topics →
Menu
New Following Discover Jobs Top Writers
More
Suggest a blog Upvotes plugin Report bug Contact About
Sign up
The home for great developer writing.
We surface the best developer writing from thousands of independent blogs, updated daily.
Join Diff.blog
TOPICS

How to write JavaScript sort comparators

12 · Flaviocopes · July 30, 2026, 8:16 a.m.
Web Development Javascript programming techniques Sort Comparators
Summary
This blog post explains how to write sort comparators in JavaScript, detailing key topics such as the return value contract, pitfalls in string sorting, techniques for multi-key sorting, and the usage of localeCompare and Intl.Collator.
Read full post on flaviocopes.com →
MORE POSTS LIKE THIS
How to Build a Browser-Based PDF Signature Tool Using JavaScript
freeCodeCamp.org · Jul 21, 2026
Javascript Web Development
How JavaScript call, apply, and bind Actually Work
jsdevspace · May 20, 2026
Web Development Javascript
Chrome’s V8 JavaScript Engine: How JavaScript Really Runs at Lightning Speed
malik-arsalan00 · Jan 13, 2026
Web Development Javascript
Learning web development: JavaScript Maps
Axel Rauschmayer · Aug 30, 2025
Web Development Javascript
How to move the first element to the end in JavaScript
Josh Sherman · Feb 16, 2025
software development Javascript
Baking physics in CSS via linear() abuse
Lean · Aug 3, 2026
Web Development CSS
Discover more posts →
AUTHOR
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub Continue with Google