Atom - i
- Index Of
Characters: i
Arity: dyadic
This atom is dyadic, which means it takes two arguments.
Functionality
Find the first index of y
in list x
, or 0
if the element is not present.
Details
Automatically casts the left argument to a singleton list if needed. This takes the element on the right and the list on the left, which is opposite of e
(Occurs). If you want to check if an element exists in a list and want the list on the left, consider using this instead of e
- even though it returns the index and not a boolean value, since Jelly is 1-indexed, 0
, the value returned if the element is not found, is the only falsy output, and thus indicates if the element is in the list.