![]() |
VOOZH | about |
The _.tail() method is used to create a new array that doesn't contain the first element of the original array.
_.tail(array);Example 1: In this example, we are getting the tail of the array by the use of the lodash _.tail() method.
Output:
[ 2, 3, 4, 5, 6, 7 ]Example 2: In this example, we are getting the tail of the array by the use of the lodash _.tail() method.
Output:
[ { name: 'npm' }, { name: 'nodejs' } ]Note: This will not work in normal JavaScript because it requires the library lodash to be installed.