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: foundations/09_sumAll/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@ Implement a function that takes 2 positive integers and returns the sum of every
6
6
sumAll(1, 4) // returns the sum of 1 + 2 + 3 + 4 which is 10
7
7
```
8
8
9
+
If the function receives invalid arguments (such as negative numbers, non-integers, strings etc. - anything other than positive integers), it should return the string `'ERROR'`.
10
+
9
11
## Hints
10
12
11
13
- How will you ensure you're summing all integers within the correct range, no matter the order of the inputs?
12
-
- 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?
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