All games

Vector Tracker

Predict what a vector prints as items are added, indexed, and looked up.

Challenge 1 of 3Score 0 / 3

Which item is at index 1 after the push?

main.rs
fn main() {
    let mut fruits = vec!["pear", "apple"];
    fruits.push("plum");
    println!("{}", fruits[1]);
}
Choose the output
Back to the lesson