while

A while loop allows you to specify a condition that must be true for the loop to continue.

    let mut arr = array![];

    let mut i: u32 = 0;
    while (i < 10) {
        arr.append(i);
        i += 1;
    };

See also

loop

Last change: 2024-04-10, commit: a0d03de