CodeIntermediate

Mutation

Also known as data mutation · mutating state

Changing an existing object or data structure in place rather than producing a separate updated value.

In the real world

items.push('new') mutates items; const next = [...items, 'new']; creates a new array.

Related

Go a little deeper