Skip to content

Commit 1fccf0f

Browse files
authored
Add example for accumulate2
1 parent 0e638ca commit 1fccf0f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/accumulate2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(reduce2 + [1 2 3 4]) # -> 10
2+
(accumulate2 + [1 2 3 4]) # -> @[1 3 6 10]
3+
4+
(reduce2 + []) # -> nil
5+
(accumulate2 + []) # -> @[]
6+
7+
(reduce2 max [1 4 2 3 9 5]) # -> 9
8+
(accumulate2 max [1 4 2 3 9 5]) # -> @[1 4 4 4 9 9]

0 commit comments

Comments
 (0)