Build a Password Generator App - Build a Password Generator App

Tell us what’s happening:

Cannot understand what is wrong here. Getting the output as expected.

Your code so far

const characters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','!','@','#','$','%','^','&','*','(',')'];

const generatePassword = (passwordLength) => {
  let password = ''; 
  const arrayLength = characters.length;

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

  return password;
};
let password = generatePassword(8)
console.log(`Generated password:${password}`);

Your browser information:

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

Challenge Information:

Build a Password Generator App - Build a Password Generator App

Hi there. You have missing a semicolon in the end of that line.

In User Story #2, the instructions say:

You should use the following string

Oh my god I didn’t know that FCC has rules on semicolons. I have previously passed some tests without this semicolon error when I knowingly didn’t put a semicolon. Are these some new changes or is there something that I am misunderstanding here.

anyway thank you very much

It’s necessary to in JavaScript to put a semicolon in the end of a variable declaration and assignment operations. You can skip semicolon only in the end of a function, object or array.