--- title: Count occurrences of a substring id: 596fda99c69f779975a1b67d challengeType: 5 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(typeof countSubstring === "function", "countSubstring is a function.");' - text: '' testString: 'assert.equal(countSubstring(testCases[0], searchString[0]), results[0], "countSubstring("the three truths", "th") should return 3.");' - text: '' testString: 'assert.equal(countSubstring(testCases[1], searchString[1]), results[1], "countSubstring("ababababab", "abab") should return 2.");' - text: '' testString: 'assert.equal(countSubstring(testCases[2], searchString[2]), results[2], "countSubstring("abaabba*bbaba*bbab", "a*b") should return 2.");' ```
## Challenge Seed
```js function countSubstring (str, subStr) { // Good luck! return true; } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```