mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Reduced _.pluck.
Former-commit-id: e413c1a6d0df383cb1ca51ab2203d3e380f71177
This commit is contained in:
@@ -619,7 +619,7 @@
|
||||
* @returns {Function} Returns a callback function.
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
if (!func) {
|
||||
if (func == null) {
|
||||
return identity;
|
||||
}
|
||||
var type = typeof func;
|
||||
@@ -2739,6 +2739,7 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {String} property The property to pluck.
|
||||
@@ -2753,9 +2754,7 @@
|
||||
* _.pluck(stooges, 'name');
|
||||
* // => ['moe', 'larry']
|
||||
*/
|
||||
function pluck(collection, property) {
|
||||
return map(collection, property + '');
|
||||
}
|
||||
var pluck = map;
|
||||
|
||||
/**
|
||||
* Reduces a `collection` to a value that is the accumulated result of running
|
||||
|
||||
Reference in New Issue
Block a user