diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md
index e586e109a3..5cf97fbeaf 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md
@@ -7,18 +7,17 @@ forumTopicId: 301193
## Description
console.log()
statements will print exactly what you tell them to print to the browser console the exact number of times you requested. In your in-browser text editor the process is slightly different and can be confusing at first.
-Values passed to console.log()
in the text editor block run each set of tests as well as one more time for any function calls that you have in your code.
-This lends itself to some interesting behavior and might trip you up in the beginning, because a logged value that you expect to see only once may print out many more times depending on the number of tests and the values being passed to those tests.
-If you would like to see only your single output and not have to worry about running through the test cycles, you can use console.clear()
.
+You may have noticed that some freeCodeCamp JavaScript challenges include their own console. This console behaves a little differently than the browser console you used in the last challenge.
+The following challenge is meant to highlight the main difference between the freeCodeCamp console and your browser console.
+When you run ordinary JavaScript, the browsers console will display your console.log()
statements the exact number of times you requested.
+The freeCodeCamp console will print your console.log()
statements for each test of that challenge, as well as one more time for any function calls that you have in your code.
+This lends itself to some interesting behavior and might trip you up in the beginning, because a logged value that you expect to see only once may print out many more times.
+If you would like to see only your single output and not have to worry about running through the test cycles, you can use console.clear()
and check the browsers console.
console.log()
to print the variables in the code where indicated.
-
+First, use console.clear()
to clear the browser console. After that, use console.log
to log the output
variable.
console.log()
to print the variables in the code where indicate
```yml
tests:
- - text: Use console.log()
to print the outputTwo
variable. In your Browser Console this should print out the value of the variable two times.
- testString: assert(code.match(/console\.log\(outputTwo\)/g));
- - text: Use console.log()
to print the outputOne
variable.
- testString: assert(code.match(/console\.log\(outputOne\)/g));
- - text: Use console.clear()
to modify your output so that outputOne
variable only outputs once.
- testString: assert(code.match(/^(\s*console.clear\(\);?\s*)$/gm));
+ - text: Use console.clear()
to clear the browser console.
+ testString: const removeJSComments = code.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, ''); const noSpaces = removeJSComments.replace(/\s/g, ''); assert(noSpaces.match(/console.clear\(\)/));
+ - text: Use console.log()
to print the output
variable.
+ testString: const noSpaces = code.replace(/\s/g, ''); assert(noSpaces.match(/console\.log\(output\)/));
```
@@ -43,18 +40,15 @@ tests: