Skip to content

Commit daf6efa

Browse files
committed
fixed if statement to be more concise
1 parent b31f116 commit daf6efa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sprint-3/2-practice-tdd/repeat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function repeat(str, count) {
77
throw new Error("First argument must be a string.");
88
}
99

10-
if (typeof count !== "number" || !Number.isInteger(count) || count < 0) {
10+
if (!Number.isSafeInteger(count) || count < 0) {
1111
throw new Error("Second argument must be a non-negative integer.");
1212
}
1313

0 commit comments

Comments
 (0)