Understanding the Differences between the freeCodeCamp and Browser Console(i tried but not working)

Tell us what’s happening:
How to satisfy this statement:
Use console.clear() to modify your output so that outputOne variable only outputs once.

Your code so far



let outputTwo = "This will print to the browser console 2 times";
console.log(outputTwo);


let outputOne = "Try to get this to log only once to the browser console";
console.clear(outputOne);   // i already used here but not working

console.log(outputOne);

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

console.clear() doesn’t take any argument

(I don’t know if it is the only issue)

2 Likes

i was really confused in that whether it takes an argument or not you are right
console.clear() doesn’t take any argument
Thank you for clarifying my doubts

Hi ieahleen, so how does console.clear() affect the code ?

the command console.clear() remove everything that is present in the console.

1 Like