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 41c1401 commit 0f15af0Copy full SHA for 0f15af0
Sprint-3/2-practice-tdd/repeat-str.js
@@ -1,5 +1,9 @@
1
-function repeatStr() {
2
- return "hellohellohello";
+function repeatStr(str, count) {
+ if (count < 0) {
3
+ throw new Error("Count cannot be negative");
4
+ }
5
+
6
+ return str.repeat(count);
7
}
8
9
module.exports = repeatStr;
0 commit comments