Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
Why sorting is harder than it seems
(opens in new tab)
(getgrist.com)
5 points
dsagal
3y ago
2 comments
Save
Share
2 comments
2 comments · 1 top-level
top
newest
oldest
pestatije
3y ago
· 1 in thread
The problem at hand is not sorting but type safety...brought to you by javascript
dsagal
OP
3y ago
It's not quite type safety, it's all about order, and it's definitely not specific to Javascript. Here's Python3:
>>> sorted([10, 2, math.nan]) [2, 10, nan] >>> sorted([10, math.nan, 2]) [10, nan, 2]
j
/
k
navigate · click thread line to collapse