Implement get(obj, path, defaultValue)
Lodash's _.get, the safe way to read a deeply nested, possibly-missing property without a chain of && checks. Write get(obj, path, defaultValue) where path is a string using dot notation for object keys and bracket notation for array indices, e.g. "a.b[0].c".
If any step along the way is null/undefined (the path doesn't exist), return defaultValue instead of throwing.
get({ a: { b: [{ c: 42 }] } }, "a.b[0].c"); // 42
get({ a: 1 }, "x.y.z", "fallback"); // "fallback", doesn't throw