[BETA]: Debugging: Differences b/w FCC & Browser Console (Lesson doesn't match output, one test might be passing erroneously)
See original GitHub issueChallenge Name
Issue Description
- The lesson states (excerpting for brevity):
When you load and run an ordinary JavaScript file in your browser the console.log() statements will print exactly what you tell them to print to the browser console the exact number of times you requested.
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.
The editor text says:
// Open your browser console
let outputTwo = "This will print to the browser console 2 times";
// Use console.log() to print the outputTwo variable
console.log(outputTwo);
However, Firefox & Chrome browser consoles both exhibit the same behavior, only printing the line once (see screenshots). I specifically left out the clear.console()
line to see the duplicated console output, but it doesn’t work.
- The tests pass whether
clear.console()
is written in the editor or not. (screenshot below)
Browser Information
- Browser Name, Version: Firefox 59.0.1 && Chrome 65.0.3325.181
- Operating System: Win 8.1, 64-bit
- Mobile, Desktop, or Tablet: Desktop
Your Code
// Open your browser console
let outputTwo = "This will print to the browser console 2 times";
// Use console.log() to print the outputTwo variable
console.log(outputTwo);
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
console.log(outputOne);
Screenshot
PROBLEM#1: Firefox Console:
Chrome Console:
PROBLEM#2
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (13 by maintainers)
Top GitHub Comments
Thank you, @raisedadead . I am looking into the console.log issue now to see if we can get FCC browser console to show console.log output, as advertised 😃
My bad, I mistook this for a client implementation of the same. Ignore my last.