Kernel.elem

You're seeing just the function elem, go back to Kernel module for more information.

Specs

elem(tuple(), non_neg_integer()) :: term()

Gets the element at the zero-based index in tuple.

It raises ArgumentError when index is negative or it is out of range of the tuple elements.

Allowed in guard tests. Inlined by the compiler.

Examples

tuple = {:foo, :bar, 3}
elem(tuple, 1)
#=> :bar

elem({}, 0)
** (ArgumentError) argument error

elem({:foo, :bar}, 2)
** (ArgumentError) argument error