Skip to content

Commit 4974e45

Browse files
committed
edited a code and amende the error name that is thrown
1 parent 963c4a6 commit 4974e45

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎practice-tdd/repeat-str.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export function repeatStr(str, count) {
66
let repeatedStr = str;
77
count = Math.floor(count);
88

9-
if (str === " ") {
10-
throw new Error("String shoild not be empty");
9+
if (str === "") {
10+
throw new Error("String should not be empty");
1111
}
1212
if (count < 0) {
1313
throw new Error("Negative counts are not valid");

0 commit comments

Comments
 (0)