3 ms·
> First comment on the bug report was: > 'This shouldn't be possible as the array is const and frozen'. Yeah const and Object.freeze() are not exactly the most
by BinaryIdiot 10y ago
> First comment on the bug report was:
> 'This shouldn't be possible as the array is const and frozen'.
Yeah const and Object.freeze() are not exactly the most intuitive depending on your level of JavaScript internals knowledge (and even then I don't think const is very intuitive but I digress).
> We'll just have to agree to disagree.
Fair enough! I would just caution trying to make complex objects immutable; it can be handy if you're developing a library and don't trust the dev on the other side (to a degree, copying may be preferable depending on the context) but it can complicate things and lead to some performance and development pattern issues.