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

Tell us what’s happening:

Hello all,

I am stuck on where to place the \n character. I have tried to place it anywhere I can think of, including places that make no sense to me, as well as concatenating it after the second string ( + “\n” +). Please help, I am missing something :-/

Your code so far

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

/* file: styles.css */

/* 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: \n";
  
}

// User Editable Region

Your browser information:

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

Challenge Information:

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

I think you need to show a lil bit more of the code for more context, but first, have you tried using string interpolation?

/* 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: \n`;

}

// User Editable Region

In general, if you need to include the value of one or more variables in a string, it is better to use interpolation

Try to remove space between : colon and \n new line character.
@anthonymgarcia45

Hello there, thank you for your help. I removed the space where you indicated and another space i had before the period in the second string… it passed!

Your welcome. Keep it up, happy Coding.