Skip to content

Commit 038bb6a

Browse files
updating count.js file
1 parent 29ef74a commit 038bb6a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎practice-tdd/count.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
export function countChar(stringOfCharacters, findCharacter) {
2-
return 5
2+
let count = 0;
3+
for (const character of stringOfCharacters) {
4+
if (character === findCharacter) {
5+
count++;
6+
}
7+
}
8+
return count;
39
}

0 commit comments

Comments
 (0)