- What does deep merge mean?
- Nested objects are merged recursively — the second object's keys override the first's, but keys that exist only in the first are preserved at every level. Shallow merge would replace entire nested objects wholesale.
- How does it handle arrays?
- Arrays are replaced, not concatenated. If the second object has a shorter array at a given key, you get the shorter array. Switch to a custom merge strategy if you need concat behavior.
- Is this useful for config layering?
- Very — it's how dotenv overrides, Kubernetes overlay files, and Next.js environment config work. Merge base + environment overrides to get the effective config.
- Does null in the override remove the key?
- No — null is a valid value and replaces the original. If you want to remove a key, use JSON Patch with a 'remove' operation.