JanetDocsI'm feeling luckyGithub sign in

find



    function
    boot.janet on line 952, column 1

    (find pred ind)
    
    Find the first value in an indexed collection that satisfies a
    predicate. Returns nil if not found. Note there is no way to
    differentiate a nil from the indexed collection and a not found.
    Consider find-index if this is an issue.


1 exampleSign in to add an example
Loading...
(def h ["a" "b" :c]) # => ("a" "b" :c)

(find (fn [a] (= "a" a)) h) # => "a"
faywong