ReScript supports for
loops.
For loops can iterate from a starting value up to (and including) the ending value via the to
keyword, or in the opposite direction via the downto
keyword.
for x in 1 to 3 {
Console.log(x)
}
for y in 3 downto 1 {
Console.log(y)
}