Curriculum Foundations Bindings and mutability exercise 3 · mcq
Bindings and mutability
Rust's numeric primitives are width-specific — there's no generic
number. Pick the right type annotation for the literal value.
About this theme
Rust flips TypeScript's mutability default. Every binding starts immutable; you opt in to mutability with let mut. Type annotations come after the name (let x: i32 = 5), and the numeric primitives are width-specific (i32, u64, f64) instead of TS's single number. Shadowing is allowed and idiomatic because it creates a fresh binding that happens to reuse the name. Planned exercises: 1. choose immutable let. 2. choose let mut. 3. recognise type annotations. 4. distinguish mutation from shadowing. 5. fill mut. 6. fill a type annotation. 7. write a rebinding line. 8. translate several TS bindings. 9. fix a program that tries to mutate an immutable binding.