Reduced _.pluck.

Former-commit-id: e413c1a6d0df383cb1ca51ab2203d3e380f71177
This commit is contained in:
John-David Dalton
2013-02-08 08:42:04 -08:00
parent 9a4e2d7617
commit db29699927
8 changed files with 164 additions and 168 deletions

View File

@@ -376,7 +376,7 @@
* @returns {Function} Returns a callback function.
*/
function createCallback(func, thisArg, argCount) {
if (!func) {
if (func == null) {
return identity;
}
var type = typeof func;
@@ -2086,6 +2086,7 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {String} property The property to pluck.
@@ -2100,9 +2101,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