Build a Password Generator App - Build a Password Generator App

Tell us what’s happening:

Based on the test description and the output, the code should be passing test 9. But it is still failing, there might be an issue with the testing environment itself, or perhaps there’s an unstated requirement for the test that isn’t clear from the description provided. #9 “You should log the generated password to the console.”
my code console.log(password); is this not the implementation for the test? Please help thank you.
Howeve

Your code so far

function generatePassword(length) {
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()";
  let password = "";

for (let i = 0; i < length; i++) {
  const randomIndex = Math.floor(Math.random() * characters.length);
password += characters[randomIndex];
}

return password;

};

const password = generatePassword(12);

console.log(password);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0

Challenge Information:

Build a Password Generator App - Build a Password Generator App

you need to follow the instructions in the last user story where it says that you need to concatenate your password variable to a specific string

1 Like

Thank you for your help!