---
id: 6920d189e36b6b60a6330fee
title: Step 3
challengeType: 1
dashedName: step-3
---

# --description--

Now, inside the loop, log the `char` variable to the console.

# --hints--

You should have a `console.log` statement with `char` as its argument inside the loop.

```js
const codeWithoutJSComments = __helpers.removeJSComments(code); 
const functionRegex = __helpers.functionRegex('printCharacters', ['str'], { capture: true });
const functionCode = codeWithoutJSComments.match(functionRegex)[1];
const normalizedFunctionCode = __helpers.removeWhiteSpace(functionCode);
const loopCodeBlock = normalizedFunctionCode.match(/for\(constcharofstr\)\{(\S*?)}/)[1]

assert.match(loopCodeBlock, /console\.log\(char\)/);
```

When the `printCharacters` function is called with the argument `'test'`, the `console.log()` statement inside the function should be called four times with the following arguments, in order: `'t'`, `'e'`, `'s'`, and `'t'`. Instead, it was called with the following arguments: `--fcc-actual--`.

```js
const consoleLogSpy = __helpers.spyOn(console, 'log');
printCharacters('test');
assert.deepEqual(consoleLogSpy.calls, [['t'], ['e'], ['s'], ['t']]);
consoleLogSpy.restore();
```

# --seed--

## --seed-contents--

```js
function printCharacters(str) {
  for (const char of str) {
--fcc-editable-region--
    
--fcc-editable-region--
  }
}
```
