Skip to content

Commit 168ce77

Browse files
committed
commit
1 parent 7dac0c8 commit 168ce77

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
function countChar(stringOfCharacters, findCharacter) {
2-
return 5
2+
let count = 0
3+
for(let i=0;i<stringOfCharacters.length;i++ ){
4+
if (stringOfCharacters[i]===findCharacter){
5+
count++
6+
}
7+
}
8+
return count
39
}
410

11+
console.log(countChar("where","e"))
12+
513
module.exports = countChar;

0 commit comments

Comments
 (0)