invoke
_.invoke(path, object)
# Ⓢ [Ⓣ][1] Ⓝ
Invokes the method at path of object.
Since
4.0.0
Arguments
path(Array|string): The path of the method to invoke.object(Object): The object to query.
Returns
(*): Returns the result of the invoked method.
Example
var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
_.invoke(['a[0].b.c.slice', 1, 3], object);
// => [2, 3]