Loops/For with a specified step: Difference between revisions

m
→‎{{header|Wren}}: Wren-trait -> Wren-iterate
m (→‎{{header|Wren}}: Wren-trait -> Wren-iterate)
Line 2,840:
</pre>
<br>
{{libheader|Wren-traititerate}}
A further and more general approach is to use a wrapper class (such as the one in the above module) which can iterate over any sequence in a stepped fashion using Wren's ''iterator protocol''.
<syntaxhighlight lang="ecmascript">import "/traititerate" for Stepped
 
// Print odd numbers under 20.
9,482

edits