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
.
filter(is_odd, [1, 2, 3, 4, 5])
// [1, 3, 5]