mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Add support for _.invoke() to take function reference.
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
_.invoke = function(obj, method) {
|
||||
var args = slice.call(arguments, 2);
|
||||
return _.map(obj, function(value) {
|
||||
return (method ? value[method] : value).apply(value, args);
|
||||
return (typeof method === "string" ? value[method] : method || value).apply(value, args);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user