Hi all,
I am trying to complete the Build a Password Generator App Lab, below is my current code but I am failing on test 8 -
- You should call the
generatePassword
function with a numeric argument and store the returned password in thepassword
variable.
I can’t for the life of me see why, can anyone point me in the right direction?
let generatePassword = (length) =>{
let output ="";
let characters="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()"
for (let i = 0; i < length; i++){
output += characters[Math.floor(Math.random()*characters.length)];
}
return output
}
let password = ""
password = generatePassword(4);
console.log(`Generated password:${password}`);
Thanks