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 06a987e commit 4b42131Copy full SHA for 4b42131
Sprint-3/2-practice-tdd/repeat.js
@@ -1,5 +1,5 @@
1
function repeat(str, count) {
2
- if (typeof count !== "number" || isNaN(count) || count < 0) {
+ if (!Number.isInteger(count) || count < 0) {
3
throw new Error("Count must be a valid number");
4
}
5
return str.repeat(count);
0 commit comments