mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Bump to v4.0.0.
This commit is contained in:
23
invoke.js
Normal file
23
invoke.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import baseInvoke from './internal/baseInvoke';
|
||||
import rest from './rest';
|
||||
|
||||
/**
|
||||
* Invokes the method at `path` of `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path of the method to invoke.
|
||||
* @param {...*} [args] The arguments to invoke the method with.
|
||||
* @returns {*} Returns the result of the invoked method.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
|
||||
*
|
||||
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
|
||||
* // => [2, 3]
|
||||
*/
|
||||
var invoke = rest(baseInvoke);
|
||||
|
||||
export default invoke;
|
||||
Reference in New Issue
Block a user