feat(client, learn): add helper functions for common validation operations (#38605)
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
@ -28,9 +28,9 @@ First, use <code>console.log</code> to log the <code>output</code> variable. The
|
||||
```yml
|
||||
tests:
|
||||
- text: You should use <code>console.clear()</code> to clear the browser console.
|
||||
testString: const removeJSComments = code.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, ''); const noSpaces = removeJSComments.replace(/\s/g, ''); assert(noSpaces.match(/console.clear\(\)/));
|
||||
testString: assert(__helpers.removeWhiteSpace(__helpers.removeJSComments(code)).match(/console.clear\(\)/));
|
||||
- text: You should use <code>console.log()</code> to print the <code>output</code> variable.
|
||||
testString: const noSpaces = code.replace(/\s/g, ''); assert(noSpaces.match(/console\.log\(output\)/));
|
||||
testString: assert(__helpers.removeWhiteSpace(code).match(/console\.log\(output\)/));
|
||||
|
||||
```
|
||||
|
||||
@ -53,8 +53,6 @@ let output = "Get this to log once in the freeCodeCamp console and twice in the
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
|
Reference in New Issue
Block a user