Immutability means not modifying existing data but creating a modified copy. In JavaScript, copying with spread ([...t], {...o}) is shallow: nested objects remain shared. structuredClone makes a deep copy. Immutability avoids unexpected side effects.
Example
const copie = { ...utilisateur, nom: 'Léa' }