書き方は以下の通り
map((x) -> x + 10, [0, 1, 2])
# => [10, 11, 12]
map((a, b) -> a + b, [1, 2, 3], [10, 20, 30])
# => [11, 22, 33]
map([1, 2, 3]) do x
x * 10
end
# => [10, 20, 30]
2020/10/18 09:50
書き方は以下の通り
map((x) -> x + 10, [0, 1, 2])
# => [10, 11, 12]
map((a, b) -> a + b, [1, 2, 3], [10, 20, 30])
# => [11, 22, 33]
map([1, 2, 3]) do x
x * 10
end
# => [10, 20, 30]