# filter
Keep elements that match a predicate.
## Syntax
[filter $list { predicate }]
## Examples
[filter @{ 1 2 3 4 5 } { ($it > 3) }] # @{ 4 5 } [filter @{ "ab" "c" "def" } { ([len $it] > 1) }] # @{ "ab" "def" }
# Pipeline @{ 1 2 3 4 5 } |> [filter { ($it > 2) }] |> [collect] |> [join ", "] # "3, 4, 5"
## Returns
List of elements where the predicate returned true (lazy sequence).
## See Also
`map`, `find`, `any?`, `all?`, `collect`