reject :: Enumerable

reject(iterator) -> Array Returns all the elements for which the iterator returned false.

Examples

$R(1, 10).reject(function(n) { return 0 == n % 2; })

// -> [1, 3, 5, 7, 9]

[ 'hello', 'world', 'this', 'is', 'nice'].reject(function(s) {

return s.length >= 5;

})

// -> ['this', 'is', 'nice']

See also

The findAll method (and its select alias) are the opposites of this one. If you need to split elements in two groups based upon a predicate, look at partition.

Enumerable: findAll | select | partition

Prototype API 1.5.0 - prototypejs.org