We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bafddd commit c67170cCopy full SHA for c67170c
1 file changed
Sprint-3/2-practice-tdd/count.js
@@ -1,9 +1,4 @@
1
function countChar(stringOfCharacters, findCharacter) {
2
- // return 0 if either the string or character is empty
3
- const hasNoInput =
4
- stringOfCharacters.length === 0 || findCharacter.length === 0;
5
- if (hasNoInput) return 0;
6
-
7
let count = 0;
8
for (const char of stringOfCharacters) {
9
if (char === findCharacter) count++;
0 commit comments