Build a Password Generator App - Build a Password Generator App

Tell us what’s happening:

Hi everyone! The code cannot pass 8th test. Can’t find any mistake… Help me please :slight_smile:

Your code so far

const generatePassword = len => {
  let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()";
  let password = [];
  for (let i = 0; i < len; i++) {
    let randomChar = chars[Math.floor(Math.random() * chars.length)];
    password.push(randomChar);
  }
  password = password.join("")
  return password
};

let password = '';
password = generatePassword(11);
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/138.0.0.0 Safari/537.36

Challenge Information:

Build a Password Generator App - Build a Password Generator App

combine these two lines maybe

1 Like