Learn-basic-javascript-by-building-a-role-playing-game - Step 119 #javascript

Hello there,

Here’s how to solve this code challenge:

Now you can build the **attack** function. First, update the **text** message to say The <monster name> attacks. , replacing <monster name> with the name of the monster. Remember you can use the concatenation operator for this.

function attack() {
  text.innerText = "The " + monsters[fighting].name + " attacks.";
}

Remember to add the spaces after “The” and before “attacks” to avoid getting errors.

Happy Coding Code Ninjas!! :cat:‍:rocket::ok_hand:

2 Likes

You saved the day! Thank you so much

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.