![]() |
VOOZH | about |
Lodash's _.invokeMap() method calls a specified method at a given path for each element in a collection, returning an array of results. Additional arguments can be passed using the args parameter.
_.invokeMap( collection, path, args );Return Value: This method returns the array of results.
Example 1: In this example, we are sorting the given array by the use of the lodash _.invokeMap() method.
Output:
[ [ 2, 6, 8], [ 0, 1, 2 ] ]
Example 2: In this example, we are spliting the given array by the use of the lodash _.invokeMap() method.
Output:
[ [ '6', '2', '8'], [ '2', '1', '0' ] ]Example 3: In this example, we are spliting the given array by the use of the lodash _.invokeMap() method.
Output:
[ [ 's', 'r', 'q', 'p'], [ 't', 'u', 'v', 'w' ] ]
[ [ 'a', 'b', 'c'], [ 'd', 'e', 'f' ] ]