Link Search Menu Expand Document

Understanding the Differences between the freeCodeCamp and Browser Console

Summary

  • console.clear() can be used to clear the console after each iteration.

Final Code

// 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()
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.