Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).
array
predicate
5.0.0
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': true }, { 'user': 'pebbles', 'active': false }]dropWhile(users, ({ active }) => active)// => objects for ['pebbles'] Copy
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': true }, { 'user': 'pebbles', 'active': false }]dropWhile(users, ({ active }) => active)// => objects for ['pebbles']
The array to query.
The function invoked per iteration.
Returns the slice of array.
Creates a slice of
array
excluding elements dropped from the beginning. Elements are dropped untilpredicate
returns falsey. The predicate is invoked with three arguments: (value, index, array).Since
5.0.0
Example