mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Reduced _.pluck.
Former-commit-id: e413c1a6d0df383cb1ca51ab2203d3e380f71177
This commit is contained in:
7
dist/lodash.compat.js
vendored
7
dist/lodash.compat.js
vendored
@@ -611,7 +611,7 @@
|
||||
* @returns {Function} Returns a callback function.
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
if (!func) {
|
||||
if (func == null) {
|
||||
return identity;
|
||||
}
|
||||
var type = typeof func;
|
||||
@@ -2731,6 +2731,7 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {String} property The property to pluck.
|
||||
@@ -2745,9 +2746,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