You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
find(enumerable, default \\ nil, fun)
Returns the first element for which fun returns a truthy value. If no such element is found, returns default.
map(enumerable, fun)
Returns a list where each element is the result of invoking fun on each corresponding element of enumerable.
reduce(enumerable, fun)
Invokes fun for each element in the enumerable with the accumulator.
reduce(enumerable, acc, fun)
Invokes fun for each element in the enumerable with the accumulator.
sum(enumerable)
Returns the sum of all elements.
ll?(enumerable, fun \\ fn x -> x end)
Returns true if fun.(element) is truthy for all elements in enumerable.
any?(enumerable, fun \\ fn x -> x end)
Returns true if fun.(element) is truthy for at least one element in enumerable.
uniq(enumerable)
Enumerates the enumerable, removing all duplicated elements.
uniq_by(enumerable, fun)
Enumerates the enumerable, by removing the elements for which function fun returned duplicate elements.
具体可以看:https://hexdocs.pm/elixir/Enum.html
项目是对标这个来做的,选了我认为用得比较高频率的函数
The text was updated successfully, but these errors were encountered: