typeover
rust curriculum

Curriculum Foundations Control flow exercise 3 · mcq

Control flow

Pick the idiomatic Rust loop that prints 0 through 4. Rust's numeric for always iterates over an iterator — the range operator builds one.

TypeScript reference
Pick the idiomatic Go translation

About this theme

Rust's if and loops look familiar, but they are expressions more often than TypeScript developers expect. This theme covers if, else if, loop, while, for, ranges, break, continue, and match only as a first glimpse. Planned exercises: 1. choose Rust if syntax without parentheses. 2. choose an if expression value. 3. recognise for n in 0..5. 4. fill a range. 5. fill break with a value from loop. 6. write a while condition. 7. write a for loop over a range. 8. translate TS branching code. 9. write a small counter that prints selected values.