It's awesome, built-in, and supported in all major browsers.
Let's learn 🧵
A common pattern in JavaScript is to create an immutable clone of an object. This is useful when you want to make mutations to it without changing the original.
For that, you'll often see code using the spread operator: `{ ...obj }`.
However, this only creates a shallow clone. This means that if the object has nested objects, they will be shared between the original and the clone.
Here, `deep` is shared between `originalObj` and `newObj`, not cloned across.