Tell us what’s happening:
I’m using firefox browser and have used the console. I ran the console.log, then the console.clear and console.log… the challenge tells me to clear browser console, but I did and it is clear. any ideas why I can’t pass this challenge?
Your code so far
// Open your browser console.
let output = "Get this to log once in the freeCodeCamp console and twice in the browser console";
// Use console.log() to print the output variable.
console.clear(output);
console.log(output);
// Run the tests to see the difference between the two consoles.
// Now, add console.clear() before your console.log() to clear the browser console, and pass the tests.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0.
Challenge: Understanding the Differences between the freeCodeCamp and Browser Console
ive tried log then clear, clear then log, log followed by clear on same line, clear followed by log on same line…still not passing. console says “console cleared”, still not working.
i don’t know what more you’re asking for. That is exactly as i input it into the browser console. I only put “enter” so you see where i hit enter after each entry of code.
let output = "Get this to log once in the freeCodeCamp console and twice in the browser console";
// Use console.log() to print the output variable.
console.clear(output);
console.log(output);
// Run the tests to see the difference between the two consoles.
// Now, add console.clear() before your console.log() to clear the browser console, and pass the tests.
As @ArielLeslie said, these two lines are in the wrong order.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
let output = "Get this to log once in the freeCodeCamp console and twice in the browser console";
// Use console.log() to print the output variable.
console.log(output);
console.clear(output);
// Run the tests to see the difference between the two consoles.
// Now, add console.clear() before your console.log() to clear the browser console, and pass the tests.