Loops/For with a specified step: Difference between revisions
jq
(jq) |
|||
Line 594:
output += 'who do we appreciate?';
document.write(output);</lang>
=={{header|jq}}==
To generate the stream (2,4,6,8):<lang jq># jq 1.4:
range(2;9) | select(. % 2 == 0)
# jq 1.4+:
range(2;9;2)</lang>
'''Example''':
reduce range(2;9;2) as $i
(""; . + "\($i), ") +
"whom do we appreciate?"</lang>
=={{header|Julia}}==
|