Skip to content

Commit b5fc505

Browse files
committed
add examples for each
1 parent 8aed1b1 commit b5fc505

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/each.janet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# prints 12345
2+
(each x [1 2 3 4 5] (prin x)) # -> nil
3+
4+
# prints 12345
5+
(each y @[1 2 3 4 5] (prin y)) # -> nil
6+
7+
# prints values from table in an unspecified order
8+
# 21 -or- 12
9+
(each x {:a 1 :b 2} (prin x)) # -> nil

0 commit comments

Comments
 (0)