Skip to content

Commit

Permalink
fix(seed-update): browser console, fCC Console, functionality of both (
Browse files Browse the repository at this point in the history
  • Loading branch information
ed42311 authored and HKuz committed Oct 17, 2017
1 parent c5ad62e commit 5214371
Showing 1 changed file with 40 additions and 0 deletions.
Expand Up @@ -67,6 +67,46 @@
"challengeType": 1,
"translations": {}
},
{
"id": "587d7b83367417b2b2512b37",
"title": "Understanding the Differences between the freeCodeCamp and Browser Console",
"description": [
"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 some of the differences between the freeCodeCamp console and the browser console.",
"First, the browser console. When you load and run an ordinary JavaScript file in your browser the <code>console.log()</code> 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 <code>console.log()</code> in the text editor block run each set of tests as well as one more time for any function calls that you have in you 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 <code>console.clear()</code>.",
"<hr>",
"Use <code>console.log()</code> to print the variables in the code where indicated.",
""
],
"challengeSeed": [
"// Open your browser console",
"let outputTwo = \"This will print to the browser console 2 times\";",
"// Use console.log() to print the outputTwo variable",
"",
"",
"let outputOne = \"Try to get this to log only once to the browser console\";",
"// Use console.clear() in the next line to print the outputOne only once",
"",
"",
"// Use console.log() to print the outputOne variable",
"",
""
],
"tests": [
"assert(code.match(/console\\.log\\(outputTwo\\)/g), 'message: Use <code>console.log()</code> to print the <code>outputTwice</code> variable. In your Browser Console this should print out the value of the variable two times.');",
"assert(code.match(/console\\.log\\(outputOne\\)/g), 'message: Use <code>console.log()</code> to print the <code>outputOne</code> variable.');",
"assert(code.match(/console\\.clear\\(\\)/g), 'message: Use <code>console.clear()</code> to modify your output so that <code>outputOne</code> variable only outputs once.');"
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {}
},
{
"id": "587d7b84367417b2b2512b34",
"title": "Use typeof to Check the Type of a Variable",
Expand Down

0 comments on commit 5214371

Please sign in to comment.