#618. Is it in the list?
When the green flag is clicked, this script runs. What will the cat say?
when green flag clicked delete all of [animals v] add [goat] to [animals v] add [horse] to [animals v] add [dog] to [animals v] say <[animals v] contains [horse]?>
animals = []
# When the green flag is clicked
animals.clear()
animals.append("goat")
animals.append("horse")
animals.append("dog")
print("horse" in animals)
const animals = [];
// When the green flag is clicked
animals.length = 0;
animals.push("goat");
animals.push("horse");
animals.push("dog");
console.log(animals.includes("horse"));
💡 Not sure? Build it in Scratch and try it out.