Enum.filter_map([1,2,3], fn item ->
if item % 2 == 0 do
{:keep, item * 2}
else
:ignore
end
end)--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/053143ce-efec-44f3-8e44-45bc36b90a67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Enum.filter_map([1,2,3], fn item ->
{item % 2 == 0, item * 2}
end) # => [4]
for item <- 1, 2, 3,rem(item, 2) == 0,do: item * 2
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.