filter


filter(fn, seq)
      

Return a sequence of elements from the sequence seq for which the function fn return true.

The function fn must be a predicate that accept a single argument. It should not modify seq.

Examples:


filter(is_odd, [1, 2, 3, 4, 5])
// [1, 3, 5]
      

Also see:

remove
take
drop
find
exists
map


Core Module Index | Contents