This week’s homework required me to generate a random password based on criteria the user has selected. I had starter code to begin with, and added to it by creating a function which ...
-
Prompt and confirm to allow user to decide length of password and types of characters.
-
Variables used to make code concise and more readable.
-
Conditional statements to alert user when input is invalid. Also used in combination with the push() method to combine all possible options based on users criteria.
-
A while, for loop, and if statement to loop through users character options and select a random value each time.
-
Return statements to stop the function from running if user does not confirm characters, or return value of new password to the function.
Once the new password had been generated and returned to the function I used the given started code to match the elements in the HTML to the value of said function, therefore displaying it to the screen.
Create your own unique password by clicking here
Shelsy Barrera
- Github: Shellsea31
- Gitlab: @Shellsea
- LinkedIn: Shelsy Barrera
- Email: elainesbarrera@gmail.com

