break
?while
loop"while the condition is met (i.e. returns true
), run the specified code"
Like for if
blocks, conditions are boolean expressions
while
fn main(){
let mut counter = 3;
while counter > 0 {
println!("{counter}...");
counter -= 1;
}
println!("GO!");
}
Yes! By using a...