example:

if guess < random_number {
        println!("too low!");
    } else if guess > random_number {
        println!("too high!");
    } else {
        println!("You win!");
    }

Blocks of code associated with the conditions in if expressions are sometimes called arms.

the condition in this code must be a bool. If the condition isn’t a bool, we’ll get an error.

Unlike languages such as Ruby and JavaScript, Rust will not automatically try to convert non-Boolean types to a Boolean.

Rust only executes the block for the first true condition, and once it finds one, it doesn’t even check the rest.

Because if is an expression (like functions), we can use it on the right side of a let statement to assign the outcome to a variable.

fn main() {
    let condition = true;
    let number = if condition { 5 } else { 6 };

    println!("The value of number is: {number}");
}

note: the page is not complete yet