New course! Every coder should learn Generative AI!
Try a free lesson0
I created a Password generator but I am getting a issue.before password undefine is written.
https://sololearn.com/compiler-playground/WD6JD1cNEUz0/?ref=app
3 Answers
+ 2
Hi Raj Singh
The 'password' variable is initially 'undefined' by default that's the reason 'undefined' is getting concatenated at the beginning of the generated password.To fix this, you can intialize 'password' variable to empty string like below.
let password="";
+ 1
Thanks NB for help.
have a great day.
0
Welcome 👍