Pet Quiz Help needed

I don’t know what is the problem can someone help me out here.

// Write an event handler function called onHear

// Complete the onHear function
function onHear(event) {
// The pet should say something in onHear.
pet.on(“spawn”, onSpawn);
pet.on(“hear”, onHear);
pet.say(“yes”);
pet.say(“yes”);
pet.say(“5”);
pet.say(“Orange and White”);
pet.say (“Anything Meaty”)
}
hero.say(“Do you understand me?”);
pet.say(“yes”);
hero.say(“Are you a cougar?”);
pet.say(“yes”);
hero.say(“How old are you?”);
pet.say(“5”);
// Ask two more questions.
hero.say(“What color is your fur”);
pet.say(“Orange and White”);
hero.say(“What food do you like to eat”);
pet.say (“Anything Meaty”)

The aim of this level is to use the pet.on("activity", nameOfFunction)

The function should have only one statement, which is the pet.say(" ")

So thats 2 lines of code for the function

The line under that should be basically the pet.on method where the activity is “hear” and the nameOfFunction is onHear (like i explained up)

Then write down the five questions your hero is gonna say without using pet.say, just five lines of code for the questions

In total 2 lines for the function one line for the pet.on and 5 lines for the questions

PS. Please format your code the next time you want to post it here using </> in the editor, thanks :slight_smile:

I’m not sure how to format it.

using this button:

1 Like

Highlight the code, then: