function
boot.janet on line 1320 , column 1
(find pred x &opt dflt )
Find the first value in `x` that satisfies `pred` . If not found ,
return `dflt` if given , or `nil` otherwise.
`x` can be a bytes , indexed , dictionary , fiber , or abstract type
with suitable `get` and `next` methods.
(find |(string/has-prefix? "a" $ ) ["be" "cat" "art" "apple" ])
# => "art"
(find |(= 2 $ ) {:a 1 :b 2 :c 3 })
# => 2
(get @"Hello" 1 )
# => 101
(find |(= 101 $ ) @"Hello" )
# => 101
(find |(> $ 3 ) {:a 1 :b 2 :c 3 })
# => nil
(def h ["a" "b" :c ]) # => ("a" "b" :c)
(find (fn [a ] (= "a" a )) h ) # => "a"