2023-11-16 01:46:45 +00:00
|
|
|
1 -> (output)
|
2023-11-07 00:10:12 +00:00
|
|
|
|
2023-11-16 02:13:14 +00:00
|
|
|
add_one = |list| => {
|
2023-11-07 00:10:12 +00:00
|
|
|
transform number in list {
|
|
|
|
number + 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-16 02:13:14 +00:00
|
|
|
foo = [1, 2, 3] -> (add_one)
|
|
|
|
|
|
|
|
(assert_equal [2 3 4] foo)
|
|
|
|
|