mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Bump to v3.7.0.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
define(['../internal/baseProperty', './map'], function(baseProperty, map) {
|
||||
define(['./map', '../utility/property'], function(map, property) {
|
||||
|
||||
/**
|
||||
* Gets the value of `key` from all elements in `collection`.
|
||||
* Gets the property value of `path` from all elements in `collection`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collection
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {string} key The key of the property to pluck.
|
||||
* @param {Array|string} path The path of the property to pluck.
|
||||
* @returns {Array} Returns the property values.
|
||||
* @example
|
||||
*
|
||||
@@ -23,8 +23,8 @@ define(['../internal/baseProperty', './map'], function(baseProperty, map) {
|
||||
* _.pluck(userIndex, 'age');
|
||||
* // => [36, 40] (iteration order is not guaranteed)
|
||||
*/
|
||||
function pluck(collection, key) {
|
||||
return map(collection, baseProperty(key));
|
||||
function pluck(collection, path) {
|
||||
return map(collection, property(path));
|
||||
}
|
||||
|
||||
return pluck;
|
||||
|
||||
Reference in New Issue
Block a user