var users = [
{ 'user': 'Ankit', 'active': false },
{ 'user': 'John', 'active': true },
{ 'user': 'Deo', 'active': false }
];
const result = _.dropWhile(users, function (o) {
return !o.active;
});
It creates a slice of an array that excludes some elements from the beginning. Elements are removed or deleted from the start until the predicate returns falsey values.
Example Demo
0 Comments