Re:JavaScript Temporal Is Coming
by ivanjermakov on Thursday January 30, 2025 @09:40PM
(#42884258)
Because it is impossible in JS? Except some crazy hacks, similar to how Java's constant string pool works, where every used object is a reference to a value in a pool of all objects.
[ Parent
| on HN ]
I wouldn’t call this a particularly crazy hack, it’s also called string interning and I reckon that’s what every language runtime does when strings are immutable (which includes javascript runtimes, also this isn’t required by the language specification).