If you would like to return the transformed list, you can use Enum.map/2.
Enum.map([1, 2, 3], fn num ->
num * 2
end)
# [2, 4, 6]
If you would like to return the transformed list, you can use Enum.map/2.
Enum.map([1, 2, 3], fn num ->
num * 2
end)
# [2, 4, 6]