1 var baseGet = require('./_baseGet');
4 * The opposite of `_.property`; this method creates a function that returns
5 * the value at a given path of `object`.
10 * @param {Object} object The object to query.
11 * @returns {Function} Returns the new function.
14 * var array = [0, 1, 2],
15 * object = { 'a': array, 'b': array, 'c': array };
17 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
20 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
23 function propertyOf(object) {
24 return function(path) {
25 return object == null ? undefined : baseGet(object, path);
29 module.exports = propertyOf;