mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-04 17:01:16 -05:00
fix(curriculum): add function's parameter information in Password Generator (#57682)
This commit is contained in:
@@ -13,8 +13,8 @@ In this lab, you'll practice using functions by building a random password gener
|
||||
|
||||
**User Stories:**
|
||||
|
||||
1. You should create a function called `generatePassword` that takes a parameter. You can name the parameter whatever you like.
|
||||
2. Your function should return a string which represents a randomly generated password. You should use the following string and different `Math` methods to help you return a new string with random characters in it: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()`.
|
||||
1. You should create a function called `generatePassword` that takes a parameter, indicating the length of generated password. You can name the parameter whatever you like.
|
||||
2. Your function should return a string which represents a randomly generated password. You should use the following string and different `Math` methods to help you return a new string with random characters in it: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()`.
|
||||
3. You should define a variable called `password` and assign it the result of calling the `generatePassword` function with a numeric argument that represents the desired password length.
|
||||
4. You should have a `console.log` that logs the message `"Generated password:"` followed by the `password` variable.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user