---
id: 69220a03729c43082ad3e9f6
title: Step 11
challengeType: 1
dashedName: step-11
---

# --description--

You’ve finished working on your `getMatchedWordCount` function!

Now you are going to test it with different data to see how it behaves.

Add a new `console.log` statement below the existing one that calls `getMatchedWordCount` with these parameters:

- sentence: `["Do", "not", "fear", "the", "dandy", "lion"]`
- match: `"dandy"`

Congratulations! You’ve completed this workshop.

# --hints--

You should have a second `console.log` statement that calls the `getMatchedWordCount` function inside.

```js
const codeWithoutJSComments = __helpers.removeJSComments(code);
const normalizedCode = __helpers.removeWhiteSpace(codeWithoutJSComments);
const normalizedConsoleLogCode = normalizedCode.match(/console\.log\(getMatchedWordCount\(\S*?\)\)/g)[1];
assert.exists(normalizedConsoleLogCode);
```

In your second `console.log` statement, call the `getMatchedWordCount` function with `["Do", "not", "fear", "the", "dandy", "lion"]` as the `sentence` argument and `"dandy"` as the `match` argument.

```js
const codeWithoutJSComments = __helpers.removeJSComments(code);
const normalizedCode = __helpers.removeWhiteSpace(codeWithoutJSComments);
const normalizedConsoleLogCode = normalizedCode.match(/console\.log\(getMatchedWordCount\(\S*?\)\)/g)[1];
assert.match(normalizedConsoleLogCode, /\[('|"|`)Do\1,('|"|`)not\2,('|"|`)fear\3,('|"|`)the\4,('|"|`)dandy\5,('|"|`)lion\6\],('|"|`)dandy\7/);
```

# --seed--

## --seed-contents--

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

function getMatchedWordCount(sentence, match) {
  let count = 0;
  
  for (const word of sentence) {
    if (word === match) {
      count++;
    }
    console.log(`Checking "${word}" against "${match}" | Running count: ${count}`);
  }
  
  return count;
}

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

--fcc-editable-region--

--fcc-editable-region--
```

# --solutions--

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

function getMatchedWordCount(sentence, match) {
  let count = 0;
  
  for (const word of sentence) {
    if (word === match) {
      count++;
    }
    console.log(`Checking "${word}" against "${match}" | Running count: ${count}`);
  }
  
  return count;
}

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

console.log(
  getMatchedWordCount(
    ["Do", "not", "fear", "the", "dandy", "lion"],
    "dandy"
  )
);
```
