Skip to content

Commit c67170c

Browse files
committed
Update solution for Sprint-3/2-practice-tdd.js
1 parent 5bafddd commit c67170c

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
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-
72
let count = 0;
83
for (const char of stringOfCharacters) {
94
if (char === findCharacter) count++;

0 commit comments

Comments
 (0)