多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## property + [link](./property "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L13640 "View in source.") + [npm](https://www.npmjs.com/package/lodash.property "See the npm package.") ``` _.property(path) ``` 创建一个返回给定对象的 `path` 的值的函数。 ### 参数 1. path (Array|string) 要得到值的属性路径 ### 返回值 (Function) 返回新的函数 ### 示例 ``` var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ]; _.map(objects, _.property('a.b.c')); // => [2, 1] _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1, 2] ```