(string, ch)
| 1 | function countChar(string, ch) { |
| 2 | let counted = 0; |
| 3 | for (let i = 0; i < string.length; i++) { |
| 4 | if (string[i] == ch) { |
| 5 | counted += 1; |
| 6 | } |
| 7 | } |
| 8 | return counted; |
| 9 | } |
| 10 | |
| 11 | function countBs(string) { |
| 12 | return countChar(string, "B"); |
no outgoing calls
no test coverage detected