JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

filter

core-api


    function
    boot.janet on line 1250, column 1

    (filter pred x)

    Given a predicate, take only elements from `x` for which `(pred 
    element)` is truthy. Returns a new array.

    `x` can be a bytes, indexed, dictionary, fiber, or abstract type 
    with suitable `get` and `next` methods.


See also:keep1 exampleSign in to add an example
Loading...
(filter (fn [x] (> x 2)) [1 2 3 4 5])  # @[3 4 5]
btbytesPlayground