File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
docs/docs/control_expressions Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 2424input = a
2525```
2626
27+ ## Return Value
28+ Loops do return the variable they are iterating after the last loop.
29+
30+ ``` js
31+ def iterate (items)
32+ foreach item in items
33+ puts (item)
34+ end
35+ end
36+
37+ a = [1 ,2 ,3 ,4 ,5 ]
38+
39+ b = iterate (a)
40+
41+ // b is now [1,2,3,4,5]
42+ ```
43+
2744## Using an integer
2845Count form zero to a given number (excluding):
2946
Original file line number Diff line number Diff line change 45454
46465
47476
48+ ```
49+
50+ ## Return Value
51+ Loops do return the variable they are iterating after the last loop.
52+
53+ ``` js
54+ def iterate (items)
55+ foreach item in items
56+ puts (item)
57+ end
58+ end
59+
60+ a = [1 ,2 ,3 ,4 ,5 ]
61+
62+ b = iterate (a)
63+
64+ // b is now [1,2,3,4,5]
4865```
You can’t perform that action at this time.
0 commit comments