Login
|
Signup
langref.org
-
ruby
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Manipulation
Perform an operation on every item of a list
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]
ruby
["ox", "cat", "deer", "whale"].map{|i| i.length}
["ox", "cat", "deer", "whale"].map{|i| i.length}
Submit a new solution for
ruby
There are 16 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)