Wilang Documentation1.0.0+4

filter#

Filter items in a matrix.

Available in: math cells, REPL.

Syntax#

filter(x, test)

Arguments and behavior#

Pass an array and a predicate callback. Only entries whose predicate returns true are kept.

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
positive(x) = x > 0
filter([-1,2,3],positive)

Expected result: matrix.

See also#

sort · map · forEach

All functions · Math guides