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: 06_repeatString/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,6 @@ Use loops to implement `repeatString` rather than using the builtin `String.prot
14
14
15
15
## Hints
16
16
17
-
-Take note of the above function call- how exactly is it being called?
17
+
-What inputs does the function need to achieve its goal?
18
18
19
-
-Create a variable to hold the string you're going to return, create a loop that repeats the given number of times and add the given string to the result on each loop.
19
+
-How can you iteratively build up the final string, using one of the inputs to control the repetition?
Copy file name to clipboardExpand all lines: 09_sumAll/README.md
+3-6Lines changed: 3 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,6 @@ sumAll(1, 4) // returns the sum of 1 + 2 + 3 + 4 which is 10
9
9
10
10
## Hints
11
11
12
-
Think about how you would do this on pen and paper and then how you might translate that process into code:
13
-
- make sure you pay attention to the function parameters
14
-
- create a variable to hold the final sum
15
-
- loop through the given numbers ([link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration))
16
-
- on each iteration add the number to the sum
17
-
- return the sum after finishing the loop
12
+
- How will you ensure you're summing all integers within the correct range, no matter the order of the inputs?
13
+
14
+
- Think about your sum's starting value. Then, how can you make sure every single number from the smaller input to the larger one (including both) gets added to it?
0 commit comments