Data Immutability in JavaScript
In JavaScript, an approach is often used where arrays and objects are not changed directly, but are first copied, and then modified. In this case, it is said that arrays and objects remain unchanged, that is, immutable.
This approach is often used in frameworks, for example, in React. In this section of the tutorial we will learn how to immutably change arrays, objects, and arrays of objects. This knowledge will be useful to us in the future.