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 2614707 commit c8c9bc1Copy full SHA for c8c9bc1
Sprint-3/2-practice-tdd/repeat.js
@@ -1,5 +1,8 @@
1
-function repeat() {
2
- return "hellohellohello";
+function repeat(word, times) {
+ if (times < 0) {
3
+ throw new Error("Count must be a non-negative number");
4
+ }
5
+ return word.repeat(times);
6
}
7
8
module.exports = repeat;
0 commit comments