Example 1 — Official: Keep Defined, Fill Missing Leaves
Existing nested values win; new leaves come from sources.
_.defaultsDeep({ a: { b: 2 } }, { a: { b: 1, c: 3 } });
// → { a: { b: 2, c: 3 } } How It Works
- Destination already has
a.b = 2. - Recurse into matching plain object
a. - b stays
2; source1is ignored. - c was missing → filled with
3.

