Skip to content

Commit 6fac035

Browse files
implemented a function to count a character repeat
1 parent 3372770 commit 6fac035

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
function countChar(stringOfCharacters, findCharacter) {
2-
return 5
1+
function countChar(str, char) {
2+
3+
return str.split(char).length -1;
34
}
45

5-
module.exports = countChar;
6+
console.log(countChar('lol', 'l'));
7+
8+
module.exports = countChar;

0 commit comments

Comments
 (0)