---
id: 6921de8d2a111d0341cff702
title: Step 8
challengeType: 1
dashedName: step-8
---

# --description--

Great, your function returns a `0`, but it doesn’t count anything yet.

To fix this, inside `getMatchedWordCount`, create a `for...of` loop with an empty code block that iterates over each word in `sentence`.

# --hints--

Your `getMatchedWordCount` function should have a `for...of` loop inside its code block.

```js
const codeWithoutJSComments = __helpers.removeJSComments(code); 
const normalizedCode = __helpers.removeWhiteSpace(codeWithoutJSComments);

assert.match(normalizedCode, /functiongetMatchedWordCount\(sentence,match\)\{letcount=0\;for\(\S+of\S+\)\{\S*?\}returncount;\}/);
```

Your `for...of` loop should iterate over the `sentence` argument of your function.

```js
const codeWithoutJSComments = __helpers.removeJSComments(code); 
const forLoopRegex = /function getMatchedWordCount\(sentence, match\) \{\s*let count = 0\;\s*for\s*\(([\S\s]*?)\)\s*\{[\S\s]*?\}\s*return count\;\s*\}/;
const forLoopCode = codeWithoutJSComments.match(forLoopRegex)[1];

assert.match(forLoopCode, /(const|let|var)\s+\w+\s+of\s+sentence/);
```

# --seed--

## --seed-contents--

```js
function printCharacters(str) {
  for (const char of str) {
    console.log(char);
  }
}
printCharacters("hello");

function getMatchedWordCount(sentence, match) {
  let count = 0;
--fcc-editable-region--
  
--fcc-editable-region--
  return count;
}

console.log(
  getMatchedWordCount(
    ["I", "really", "really", "really", "like", "to", "code"],
    "really"
  )
);
```
