Remix.run Logo
procaryote 10 hours ago

There's a lot wrong with Javascript's Date, but the fact that it's an object is is not really in the top 10.

Would it have been nice if the Date object had been immutable? Sure, but the fact that changing the mutable object does indeed change the object shouldn't be a shock

chowells 7 hours ago | parent [-]

It's definitely a shock when something else changes the date object you've been holding on to. The problem with mutable values has never been when you (that is, the local context) change them. It's always that you can't trust that nothing else (some very non-local code) does.

petesergeant an hour ago | parent [-]

That’s how every other object works, why would that be surprising?

kortilla 18 minutes ago | parent [-]

The lack of const means having objects as arguments is pretty dangerous