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: Week3/MAKEME.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,24 +101,23 @@ console.log(y);
101
101
102
102
Don't you just love the thrill of the lottery? What if I told you we can make our own lottery machine?
103
103
104
-
1. Write a function that takes 4 arguments.
104
+
1. Write a function, called `generateNumbers` that takes 4 arguments.
105
105
- A start value
106
106
- An end value
107
107
- A callback that executes if the number is divisible by 3
108
108
- A callback that executes if the number is divisible by 5
109
+
2.`generateNumbers` generates an array containing values from start value to end value (inclusive).
109
110
110
-
The function should first generate an array containing values from start value to end value (inclusive).
111
+
Then the function should take the newly created array and iterate over it, and calling the first callback if the array value is divisible by 3. The callback should simply return the string "The number [i] is divisible by 3!"
111
112
112
-
Then the function should take the newly created array and iterate over it, and calling the first callback if the array value is divisible by 3.
113
+
If the iterated value is divisible by 5, execute the second callback. The callback should simply return the string "The number [i] is divisible by 5!"
113
114
114
-
The function should call the second callback if the array value is divisible by 5.
115
-
116
-
Both functions should be called if the array value is divisible by both 3 and 5.
115
+
Both callbacks should be executed if the array value is divisible by both 3 and 5.
0 commit comments