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 e2c54d6 commit 1014714Copy full SHA for 1014714
Sprint-3/3-mandatory-practice/implement/count.js
@@ -1,5 +1,11 @@
1
function countChar(stringOfCharacters, findCharacter) {
2
- return 5
+ // return 5; //This will always return 5, regardless of the inputs. So it’s just a placeholder.
3
+ return stringOfCharacters.split(findCharacter).length - 1;
4
}
5
-module.exports = countChar;
6
+module.exports = countChar;
7
+
8
+// console.log(countChar("hello", "l")); // 2
9
+// console.log(countChar("hello world", "o")); // 2
10
+// console.log(countChar("banana", "a")); // 3
11
+// console.log(countChar("mississippi", "i")); // 5
0 commit comments