Re:JavaScript Temporal Is Coming
by sureIy on Thursday January 30, 2025 @08:33PM
(#42883965)
Why not just use 'String()' or '2020-01-01'?
[ Parent
| on HN ]
Re:JavaScript Temporal Is Coming
by justingrantjg on Thursday January 30, 2025 @09:18PM
(#42884167)
Temporal includes `equals` methods on every type. String comparison sometimes works, but there are enough cases where it doesn't (especially when comparing strings that refer to the same data but were generated by different libraries so formatting is different for things like trailing zeroes of decimals, time zone aliases, etc.) that it's usually best to use a library function for comparison instead of just using string comparison.
Re:JavaScript Temporal Is Coming
by 8n4vidtmkvmk on Thursday January 30, 2025 @10:39PM
(#42884507)
Comparison functions are unlikely to work across libraries too?