JSFiddle - React, Tailwind, and code Playground

JavaScript

var a = {
        X: 'good',
        Y: {
            Z: 'good'
        }
    },
    b = $.extend({}, a);

b.X = 'bad';
b.Y.Z = 'bad';

// You'll see that a.Y.Z has been modified :
console.log(JSON.stringify(a));