DLiteScript

arrays.filter

Filters out falsy values from an array.

Examples

1
2
3
4
arrays.filter([1, 0, 2, false, 3, "", 4]) // returns ([0, false, ""], [1, 2, 3, 4])
arrays.filter([true, false, "hello", ""]) // returns ([false, ""], [true, "hello"])
arrays.filter([1, 2, 3]) // returns ([], [1, 2, 3])
arrays.filter([]) // returns ([], [])
Improve this page