This tutorial doesn't work

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console

Even though, there is nothing wrong with my code. This section doesn’t give me a pass.

// 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
console.clear(outputOne);

// Use console.log() to print the outputOne variable
console.log(outputOne);

console.clear does not take an argument.

1 Like

You haven’t gotten the correct code. Check what you are clearing from your console.
Hint:

console.clear() doesn’t take any arguments

Solution
// 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
console.clear();  //<-- no parameters

// Use console.log() to print the outputOne variable
console.log(outputOne);
1 Like

I didn’t see the hint but thank you so much for the reply. I feel kind of embarrassed right now.

2 Likes

Nothing to be embarrased about. We all have little mistakes.

1 Like