I have a single element/number that I am piping to Enum.into([])
but Elixir throws ** (Protocol.UndefinedError) protocol Enumerable not implemented for 90
90 |> Enum.into([])
v = 65
v |> Enum.into([]) Enumerable not implemented for 65
Enum.into/2 expects an Enumerable as the first argument, hence the error.
To pipe a Single Element into a list, use List.wrap
65 |> List.wrap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With