Skip to content

Commit 3c6180c

Browse files
committed
Ensure all lines have consistent semi-colons
1 parent cf3dfcc commit 3c6180c

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎practice-tdd/count.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export function countChar(stringOfCharacters, findCharacter) {
22
const occurrences = stringOfCharacters.split(findCharacter);
3-
return occurrences.length - 1
3+
return occurrences.length - 1;
44
}

‎practice-tdd/get-ordinal-number.js‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
export function getOrdinalNumber(num) {
2-
let numSlicedToLastTwo = String(num).slice(-2);
3-
if (numSlicedToLastTwo.length < 2) {
4-
numSlicedToLastTwo = numSlicedToLastTwo.padStart(2, "0")
5-
}
6-
numSlicedToLastTwo = numSlicedToLastTwo
72
if (String(num).slice(-2) === "11"){
8-
return `${num}th`
3+
return `${num}th`;
94
}
105
else if (String(num).slice(-2) === "12"){
11-
return `${num}th`
6+
return `${num}th`;
127
}
138
else if (String(num).slice(-2) === "13"){
14-
return `${num}th`
9+
return `${num}th`;
1510
}
1611
if (String(num).slice(-1) === "2") {
1712
return `${num}nd`;
@@ -20,5 +15,5 @@ export function getOrdinalNumber(num) {
2015
} else if (String(num).slice(-1) === "1") {
2116
return `${num}st`;
2217
}
23-
return `${num}th`
24-
}
18+
return `${num}th`;
19+
};

‎practice-tdd/repeat-str.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ export function repeatStr(str, count) {
44
throw new Error("Please enter a non-negative number");
55
}
66
else if (count === 0){
7-
return ""
7+
return "";
88
}
99
else if (count === 1) {
10-
return str
10+
return str;
1111
}
1212
for (i = 0; i < count; i++) {
13-
repeatedString += str
13+
repeatedString += str;
1414

1515
}
16-
return repeatedString
16+
return repeatedString;
1717
}

‎practice-tdd/repeat-str.test.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ test("should repeat the string 0 times, returns empty str", () => {
3737
const repeatedStr = repeatStr(str, count);
3838
expect(repeatedStr).toEqual("");
3939
});
40+
4041
// Case: Handle negative count:
4142
// Given a target string `str` and a negative integer `count`,
4243
// When the repeatStr function is called with these inputs,

0 commit comments

Comments
 (0)