Example 1 — Drop Even Numbers
Reject values that pass “is even” — keep the odds.
var odds = _.reject([1, 2, 3, 4, 5, 6], function (num) {
return num % 2 === 0;
});
// → [1, 3, 5] How It Works
- Predicate.
num % 2 === 0means “even.” - Drop passers. Evens match and are removed.
- Keep failures. Odds fail the test and stay.
- New array. Source
[1…6]is unchanged.

