Files
lodash/invoke.js
John-David Dalton 466c67a8b6 Bump to v4.1.0.
2016-01-29 01:20:57 -08:00

24 lines
597 B
JavaScript

import baseInvoke from './_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;