JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

find-index

core-api


    function
    boot.janet on line 1304, column 1

    (find-index pred x &opt dflt)

    Find the index of `x` for which `pred` is true. If not found, 
    return `dflt` if provided, or `nil` otherwise.

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


See also:find1 exampleSign in to add an example
Loading...
(find-index |(= $ "b") ["a" "b" "c" "d"]) #=> 1
AlecTroemelPlayground