List.keyfind/4
defmodule List do
def keyfind(list, key, index, default \\ nil)
end
Receives a list of tuples and returns the first tuple where the index
-th element is the given key
.
If no matching tuple is found, default
is returned.
defmodule List do
def keyfind(list, key, index, default \\ nil)
end
Receives a list of tuples and returns the first tuple where the index
-th element is the given key
.
If no matching tuple is found, default
is returned.