Skip to content

Commit 3dce6cd

Browse files
committed
2-practice-tdd count.js updated code
1 parent cfbead8 commit 3dce6cd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ function countChar(stringOfCharacters, findCharacter) {
77
}
88
return count;
99
}
10-
console.log(countChar("please work for me", "e" ))
10+
//console.log(countChar("please work for me", "e" )) //output is: 3
1111

12-
module.exports = countChar;
12+
// module.exports = countChar;
13+
14+
// function assertEquals(actualOutput, targetOutput) {
15+
// console.assert(
16+
// actualOutput === targetOutput,
17+
// `Expected ${actualOutput} to equal ${targetOutput}`
18+
// );
19+
// }
20+
21+
// assertEquals(countChar("aaaaa", "a" ), 5);
22+
// assertEquals(countChar("venue", "b" ), 0);
23+
// assertEquals(countChar("", "x" ), 0);
24+
25+
// try {
26+
// countChar(12);
27+
28+
// // This line will not be reached if an error is thrown as expected
29+
// console.error("Error was not thrown for invalid string");
30+
// } catch (error) {}

0 commit comments

Comments
 (0)