You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: LICENSE
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ Copyright (c) 2023 Dairon Reijna
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
7
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
8
9
9
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[W3Schools (n.d.) JavaScript For .. In - Loop](https://www.w3schools.com/js/js_loop_forin.asp)
115
+
116
+
[Stack Overflow (n.d.) How to iterate over a JavaScript object?](https://stackoverflow.com/questions/14379274/how-to-iterate-over-a-javascript-object)
117
+
118
+
[Stack Overflow (n.d.) Why is using "for...in" for array iteration a bad idea?](https://stackoverflow.com/questions/500504/why-is-using-for-in-for-array-iteration-a-bad-idea)
119
+
120
+
[MDN Web_docs (n.d.) The for...in statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in)
121
+
122
+
[Shahed Nasser (2022) How to Use the for Loop in JavaScript](https://www.sitepoint.com/javascript-for-loop/)
User will visit website and will see a container/card with a heading, a prompt, and a button to generate a password.
5
+
The user will click the generate a password button.
6
+
7
+
How long due you want the password to be?
8
+
9
+
Do you want capital letters in the password?
10
+
Do you want numbers to be generated in the password?
11
+
12
+
Would you like special characters in the password?
13
+
14
+
Alert - The user will receive an output from the webpage with a password that has been generated.
15
+
16
+
(Important to take the time to consider how the website will work from three perspectives. For this section, the output from this round would be a wireframe of the website to be built, with relevant elements incorporated)
17
+
18
+
# What developer has to do
19
+
============================================
20
+
21
+
Make button clickable.
22
+
23
+
A prompt that will request for password length.
24
+
Check to make sure appropriate number (value and type) has been entered by user.
25
+
26
+
second 'confirm' to request - if characters should include capitalisation.
27
+
if true then yes added within generated password.
28
+
if false then none added
29
+
30
+
3rd 'confirm' to request - if user wants characters to include numbers.
31
+
if true then yes added within generated password.
32
+
if false then none added
33
+
34
+
4th and last 'confirm' to ask user if they would like special characters within the generated password.
35
+
if true then yes added within generated password.
36
+
if false then none added
37
+
38
+
An alert provides the user with the generated password.
39
+
40
+
(Options are prompt - alert or confirm.)
41
+
42
+
43
+
# Tools to accomplish above tasks.
44
+
=========================================
45
+
46
+
1. generate password button should call a function
47
+
2. Prompt to request password length
48
+
3. Confirm for user to decide inclusion of capital letters
49
+
Add to potential characters that can be choosed from.
50
+
4. Confirm for user to decide inclusion of numbers
51
+
Add to potential characters that can be choosed from.
52
+
5. Confirm for user to decide inclusion of special characters
53
+
Add to potential characters that can be choosed from.
54
+
6. Ensure that Code validates each user input.
55
+
56
+
7. Alert to user
57
+
58
+
8. create an array that will allow the relevant function/code to call from, and pull potentialCharacters for the generatedPassword.
59
+
so atleast I need one array
60
+
9. using a for loop to iterate over the new array, in order to generate the new password.
61
+
62
+
Code will need something to randomly choose from the choices available.
63
+
64
+
Return math.ceil(Math.random() * userInput)
65
+
66
+
And use this to iterate over the array.index to get the characters you need.
0 commit comments