Skip to content

Commit bc44c63

Browse files
authored
Merge pull request #284 from rwtolbert/example_each
add examples for each
2 parents 8a31ba5 + 4e733cf commit bc44c63

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/each.janet

+9
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 struct in an unspecified order
8+
# 21 -or- 12
9+
(each x {:a 1 :b 2} (prin x)) # -> nil

0 commit comments

Comments
 (0)