check if value exists in given collection
Parameters
in? value :any
collection :string :dictionary :block :range
Attributes
at | :integer | check at given location within collection |
Returns
Examples
copy
arr: [1 2 3 4]
in? 5 arr ; => false
in? 2 arr ; => true
copy
user: #[
name: "John"
surname: "Doe"
]
in? "John" dict ; => true
in? "Paul" dict ; => false
in? "name" keys dict ; => true
copy
in? "x" "hello" ; => false
in? `h` "hello" ; => true
copy
in?.at:1 "el" "hello" ; => true
in?.at:4 `o` "hello" ; => true
copy
print in?.at:2 "two" ["one" "two" "three"]
; false
print in?.at:1 "two" ["one" "two" "three"]
; true
Related