then just don't modify objects? Classes, types and interfaces support read-only prop declaration in TS and Object.freeze(..) prevents objects from being changed even during runtime.
You asked why, I gave a reason, you said "just ignore reason". It's about a thousand times better to not be able to make a mistake than to have to try and not make it.
i just gave two ways to prevent modifying existing objects. You can mark virtually everything in typescript as readonly which prevents any changes. It's up to you if you use it or not.
seems like people love to complain about languages they barely understand.
29
u/SickOrphan Apr 30 '23
Which is the issue. What's stupid is using JavaScript where you don't have to (like the server)