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 d09a54e commit b9967faCopy full SHA for b9967fa
Sprint-3/2-practice-tdd/repeat-str.js
@@ -1,6 +1,6 @@
1
function repeatStr(str, count) {
2
- if (count >= 0) return str.repeat(count);
3
- else throw new Error("Invalid format: count cannot be");
+ if (count < 0) throw new Error("Invalid format: count cannot be negative");
+ return str.repeat(count);
4
}
5
6
module.exports = repeatStr;
0 commit comments