Jump to content

Loops/Foreach: Difference between revisions

m
→‎{{header|Sidef}}: added the `for-in` loop
mNo edit summary
m (→‎{{header|Sidef}}: added the `for-in` loop)
Line 1,760:
 
=={{header|Sidef}}==
'''foreach''' loop:
<lang ruby>foreach [1,2,3] { |i|
say i;
}</lang>
 
'''for-in''' loop:
same as:
<lang ruby>for i in [1,2,3] {
say i
}</lang>
 
'''.each''' method:
<lang ruby>[1,2,3].each { |i|
say i;
}</lang>
 
2,756

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.