diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.md index e13f2b4a1f..b34b67a890 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.md @@ -14,10 +14,16 @@ There are many methods to use with `console` to output messages. `log`, `warn`, # --instructions-- -First, use `console.log` to log the `output` variable. Then, use `console.clear` to clear the browser console. View the difference in the two consoles. +First, open your browser console so you can see the logs. To do that, you can right-click the freeCodeCamp navigation bar at the top and click `inspect` on most browsers. Then find the `console` tab in the window that opens. After that, use `console.log` to log the `output` variable. View the two consoles to see the log. Finally, use `console.clear` after your log to clear the browser console. View the difference in the two consoles. # --hints-- +You should use `console.log()` to print the `output` variable. + +```js +assert(__helpers.removeWhiteSpace(code).match(/console\.log\(output\)/)); +``` + You should use `console.clear()` to clear the browser console. ```js @@ -28,10 +34,14 @@ assert( ); ``` -You should use `console.log()` to print the `output` variable. +You should clear the console after your log. ```js -assert(__helpers.removeWhiteSpace(code).match(/console\.log\(output\)/)); +assert( + __helpers + .removeWhiteSpace(code) + .match(/console\.log\(output\)[\s\S]*console.clear\(\)/) +); ``` # --seed-- @@ -39,27 +49,15 @@ assert(__helpers.removeWhiteSpace(code).match(/console\.log\(output\)/)); ## --seed-contents-- ```js -// Open your browser console. let output = "Get this to show once in the freeCodeCamp console and not at all in the browser console"; -// Use console.log() to print the output variable - -// View the freeCodeCamp console and the browser console - -// Now, add console.clear() after your console.log() to clear the browser console ``` # --solutions-- ```js -// Open your browser console let output = "Get this to show once in the freeCodeCamp console and not at all in the browser console"; -// Use console.log() to print the output variable console.log(output); - -// View the freeCodeCamp console and the browser console - -// Now, add console.clear() after your console.log() to clear the browser console console.clear(); ```