#608. List item
When the green flag is clicked, this script runs. What will the cat say?
when green flag clicked delete all of [fruits v] add [pear] to [fruits v] add [watermelon] to [fruits v] add [strawberry] to [fruits v] add [orange] to [fruits v] add [apple] to [fruits v] say (item (2) of [fruits v])
fruits = []
# When the green flag is clicked
fruits.clear()
fruits.append("pear")
fruits.append("watermelon")
fruits.append("strawberry")
fruits.append("orange")
fruits.append("apple")
print(fruits[1])
const fruits = [];
// When the green flag is clicked
fruits.length = 0;
fruits.push("pear");
fruits.push("watermelon");
fruits.push("strawberry");
fruits.push("orange");
fruits.push("apple");
console.log(fruits[1]);
💡 Not sure? Build it in Scratch and try it out.