Lodash _.dropWhile() Method
The Loadsh.dropWhile() method is used to return the slice of the given array. This takes a predicate function that iterate through each element of the array and if the function returns false, it returned the sliced array excluding elements dropped from the beginning.
- array: It is the array that is to be sliced.
- predicate: It is the function that either returns true or false depending on the condition given.
Return Value: It returns the new array after slicing.
Note: Please install lodash module by using command
npm install lodash before using the code given below.
Example 2: When array of object is given.