Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

List.filter

filter($callbackFunction)

Description

Keep or remove items in the List.

If the callback returns true, the item is kept in the List. Otherwise, it is removed.

Returns a List of filtered items.

(This example uses Expression Function notation x{ ... }.)

[1, -2, 3, -4, 5].filter(x{ $a > 0 });
//= [1, 3, 5]

See Also