Perform an operation on every item of a list, e.g.
for the list
["ox", "cat", "deer", "whale"] calculate
the list of sizes of the strings, e.g.
[2, 3, 4, 5]
erlang lists:map(fun (X) ->length(X) end, List).
lists:map(fun (X) ->length(X) end, List).
Submit a new solution for
erlang
There are 16 other solutions in
additional languages (
clojure,
cpp,
csharp,
fantom ...)