Example 1 — Official: Nested Path String
Bracket and dot notation walk arrays and objects safely.
var object = { 'a': [{ 'b': { 'c': 3 } }] };
_.get(object, 'a[0].b.c');
// → 3 How It Works
- Start. Object has key
aholding an array. - Index.
[0]selects the first element. - Nest.
.b.cwalks into nested objects. - Result. Resolved value is
3.

