1 var baseGet = require('./_baseGet');
4 * Gets the value at `path` of `object`. If the resolved value is
5 * `undefined` the `defaultValue` is used in its place.
10 * @param {Object} object The object to query.
11 * @param {Array|string} path The path of the property to get.
12 * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
13 * @returns {*} Returns the resolved value.
16 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
18 * _.get(object, 'a[0].b.c');
21 * _.get(object, ['a', '0', 'b', 'c']);
24 * _.get(object, 'a.b.c', 'default');
27 function get(object, path, defaultValue) {
28 var result = object == null ? undefined : baseGet(object, path);
29 return result === undefined ? defaultValue : result;