Lodash _.tap() Method
The _.tap() method of Sequence in lodash is used to call interceptor. Moreover, the main task of the method is to “tap into” a method chain sequence so that the intermediate results can be modified.
Parameters: This method accepts two parameters as mentioned above and described below:
- value: It is the value to be given to the interceptor.
- interceptor: It is the function to be called.
Return Value: This method returns the value.
[ 5, 6, 7, 8 ]
[ 'Geeks', 'for', 'Geeks' ]
Example 3: Using pop operation and tail method.
[ 'g' ]