Skip to content

Commit 4e2d6be

Browse files
committed
Revert unwanted folder 2-practice-tdd
1 parent 7a3bb54 commit 4e2d6be

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
function countChar(stringOfCharacters, findCharacter) {
2-
let output = 0;
3-
for( let i=0; i <= stringOfCharacters.length; i++ ) {
4-
if(stringOfCharacters[i] === findCharacter)
5-
output++;
6-
}
7-
return output;
2+
return 5
83
}
94

105
module.exports = countChar;

Sprint-3/2-practice-tdd/count.test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,3 @@ test("should count multiple occurrences of a character", () => {
2222
// And a character char that does not exist within the case-sensitive str,
2323
// When the function is called with these inputs,
2424
// Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str.
25-
test("should return 0 if there are no occurrences at all", () => {
26-
const str = "Hello World!";
27-
const char = "a";
28-
const count = countChar(str, char);
29-
expect(count).toEqual(0);
30-
});

0 commit comments

Comments
 (0)