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

Tell us what’s happening:

After the while loop, set text.innerText to equal You picked <someGuess>. Here are the random numbers: . Replace <someGuess> with the guess function parameter.

What am I missing here? Someone guide me.

Your code so far

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:";

  }
 
}

Your browser information:

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

Challenge Information:

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

1 Like

You have a few issues

The first issue is that this should be below the while loop like the directions say

once you fix that, then you have some spacing issues.

You don’t need a space here

but you do need a space here

because you want the sentence to say You picked 8 not You picked8.
Notice those spacing differences there

Then the last issue is here

remove the space before the period

once you fix all of those things, then it will pass

3 Likes