Immutability means never modifying state in place — instead, you create a new object/array with the changes. This is central to how React, Redux, and similar tools detect changes and update the UI correctly.
The problem with mutating
() {
items.(item);
(items);
}
() {
([...items, item]);
}
