The Leaderboard That Ranked 9 Points Above 100
Why JavaScript's sort() compares numbers as strings, why a 'lazy' comparator works in Safari but breaks in Chrome, and the one-line fix.
Tag archive
Why JavaScript's sort() compares numbers as strings, why a 'lazy' comparator works in Safari but breaks in Chrome, and the one-line fix.

Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3]: map passes the index as parseInt's radix. Plus the Number('') trap hiding in the obvious fix.

Years ago, a colleague of mine told me about two pockets of foreign land surrounded by Switzerland:...
HTML is easy, said every developer ever. HTML is deceptively simple. You open a tag, you close a...

Last week, I described several approaches to OpenTelemetry on the JVM, their requirements, and their...
When you pass a slice to a function and try to change the element of slice, it works. But when you...
Some gotchas we've had to learn the hard way when working with Date in Javascript