Re:Date is out, Temporal is in
by WorldMaker on Monday January 12, 2026 @08:58PM
(#46596560)
The fun trick is that Invalid Date is still a Date:
You were half-correct on expecting NaN, it's the low level storage of Invalid Date:
Invalid Date is just a Date with the "Unix epoch timestamp" of NaN. It also follows NaN comparison logic:
It's an interesting curio directly related to NaN.
[ Parent
| on HN ]
> Invalid Date is just a Date with the "Unix epoch timestamp" of NaN. It also follows NaN comparison logic:
>
> > invalid === new Date(NaN)
> false
This is just because a JS Date is an object and have nothing to do with the inner representation.
> new Date(0) === new Date(0)
false