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

Tell us what’s happening:

I have an error telling me the following: your for loop should have i initialized from 0, but I don’t know what to do, can someone help me please?

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:\n";
  for (let i=0; i < 10, i++) {

  }
}

// 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/134.0.0.0 Safari/537.36

Challenge Information:

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

You have the right idea, and you’re very close, but you have an itty bitty syntax error in this line. Check each character, one at a time, slowly. Welcome to debugging lol.

1 Like

Thank you, I was going crazy trying to find the error and couldn’t go further cause of it. I think it was because I programmed all day and was tired that I didn’t check everything. Have a nice day!

1 Like