We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f0c704 commit 9e74422Copy full SHA for 9e74422
Sprint-3/2-practice-tdd/repeat.js
@@ -1,4 +1,7 @@
1
function repeat(str, count) {
2
+ if (str === undefined || count === undefined){
3
+ throw new Error ("argument must be defined")
4
+ }
5
if (count < 0) {
6
throw new Error("Count must be a non-negative integer");
7
}
@@ -13,5 +16,5 @@ function repeat(str, count) {
13
16
14
17
module.exports = repeat;
15
18
-console.log(repeat("hello", 3));
19
+
20
0 commit comments