const generatePassword = length => {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()'
let password = ''
for (let i = 0; i < length; i++) {
password += characters[Math.floor(Math.random() * characters.length)]
}
return password
}
const password = generatePassword(8)
console.log(`Generated password: ${password}`)
all test have passed except 8: You should call the generatePassword function with a numeric argument and store the returned password in the password variable.
Challenge Information:
Build a Password Generator App - Build a Password Generator App
Just pasting the error message isn’t the same thing as describing the problem in your own words. Professional programmers have to describe code in their own words all the time, but its a skill that takes a lot of practice to get good at.