Tell us what’s happening:
I’m confused as to how to complete this code as I’ve never done something for JavaScript that requires debugging. How do I complete this challenge?
Your code so far
// 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
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36 Avast/72.0.1174.122.
Your browser has an inbuilt console for logging. In Chrome on Windows/Linux, you can view it by pressing Ctrl + Shift + J.
Any call to console.log(myVar) outputs the value of myVar to the console. Calling console.clear() clears everything previously output to the console.
If your fCC code contains calls to console.log(), they will be run every time that bit of code runs, so you may see multiple log outputs for a single call, because the fCC test suite often runs your functions many times with different inputs to check that they work correctly.
To pass this challenge, you just need to log the two variables and clear the console.
I figured it out, somehow. My brain just isn’t working today, and I’m not sure why. I’m doing all of this to prepare for my two new courses in school starting Monday, and I’m just about prepared, yet I’m not fully prepared at all. I’m just having an off day, and picked a bad day to start coding again, it seems.