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

Tell us what’s happening:

Hello! Ive tried several spacing variations to no avail. Please help!

I keep receiving the “spacing matters” error.

Many thanks!

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

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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 165

Is there a space after the guess and before the period?

I updated my code to the below, and still giving the same error. Im not sure if you were hinting at adding a space after the guess? I also added the . to the 2nd string. thank you

text.innerText = "You picked " + guess + ". Here are the random numbers:";

  • I also tried it with a space before the period

Hi there!

That line of code is now correct. It’s passing for me. You have accidentally deleted the closing curly bracket } of the function guess

1 Like

Hi @ceejay

Here is a comparison of the original code and your code.

The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.

As @hasanzaib1389 mentioned, the pick function is missing a closing curly brace.

Please remove the white space before the period.

Happy coding

1 Like

I appreciate your help! I was able to pass!

1 Like