fix(curriculum): add function's parameter information in Password Generator (#57682)

This commit is contained in:
Krzysztof G.
2024-12-22 18:40:20 +01:00
committed by GitHub
parent 77ea3223c6
commit 8a69d994a7

View File

@@ -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.