Learn Basic JavaScript by Building a Role Playing Game - Step 166

Tell us what’s happening:

I have tried alot in this step but couldn’t pass this.

Your code so far

<!-- file: index.html -->

/* file: script.js */
// User Editable Region

function pick(guess) {
  const numbers = [];
  while (numbers.length < 10) {
    numbers.push(Math.floor(Math.random() * 11));
  }
  text.innerText = "You picked " + guess + ". Here are the random numbers: ";
}

// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 166

Hi there, welcome to the fcc community.

At the end of the string, before the final quote, insert the new line escape character \n

I don’t see \n character at the end in your code, but I see an empty space.

text.innerText = "You picked " + guess + “\n. Here are the random numbers:”;
look i try out all things like this i put back forward with strings nd without but it didnt workout so i need proper solution

The instruction said: “At the end of the string”, that means right after the text ''random numbers:"

1 Like