arrow_backBACK TO DRILLS
Black Belt - Hardimmutability

Shared Object Reference Between Two Variables

Two different objects both reference the same nested object:

//REACT_MODULE
const artwork = { city: 'Hamburg' };
const objA = { artwork };
const objB = { artwork };

If React state later mutates objB.artwork.city, what happens?

BugDojo
BlogFAQ

© 2026. Carved in code.