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

Got stuck at the 169 step. Help me

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”;
for (let i = 0; i < 10; i++) {
}
text.innerText +=numbers[i,”\n"];
text.innerText += numbers[i]
}

Challenge Information:

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

Why have you got this twice?

I thought they said to add a new line

Yes, which is what you did with the first line

You don’t need the second line

2 Likes

yep .now i understanded it

text.innerText += numbers[i] + “\n”; is what worked not [i,“\n”];

2 Likes

yes this works for the most

What if you add the newline character ‘\n’ outside the array index access?"

@pianistgirl81

The \n was inside the quotes in the previous step, so imagine it needs to be in quotes in this step. How would you add something in quotes in this situation after something not in quotes?

Hope this helps. :+1: