3 ms·
> 3) const + deep Object.freeze() makes for a complete const. The trouble with this approach is that runtime checks are only a guarantee that the code you've _
by braythwayt 11y ago
> 3) const + deep Object.freeze() makes for a complete const.
The trouble with this approach is that runtime checks are only a guarantee that the code you've _exercised_ does not break the contract.
In that respect, `const` is deeply different than `.freeze`, in the same way that runtime assertions are deeply different than type checking.
- pm24601 11y agoHuh? That's why I pointed out the joint usage. And either way, a instant failure is better than a silent change.