Question : elixir enum all
Answered by : juan-d-khusuma
Enum.all?(["foo", "bar", "hello"], fn(s) -> String.length(s) == 3 end)
false
Enum.all?(["foo", "bar", "hello"], fn(s) -> String.length(s) > 1 end)
true
Source : https://elixirschool.com/en/lessons/basics/enum | Last Update : Fri, 20 May 22
Question : elixir enum any
Answered by : juan-d-khusuma
Enum.any?(["foo", "bar", "hello"], fn(s) -> String.length(s) == 5 end)
true
Source : https://elixirschool.com/en/lessons/basics/enum | Last Update : Fri, 20 May 22