2 ms·
The idea is that a given object never changes, but it's straightforward and efficient to create a new object from the original one with some of the values chang
by jimbokun 4y ago
The idea is that a given object never changes, but it's straightforward and efficient to create a new object from the original one with some of the values changed.
This is "safer" for any code still operating on the original object, as it will not be changed unexpectedly.