• Skip to main content
  • Skip to search
  • Skip to select language
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. console
  4. console.clear()
  • Change language

Table of contents

  • Syntax
  • Specifications
  • Browser compatibility

console.clear()

The console.clear() method clears the console if the environment allows it.

Syntax

console.clear();

Specifications

Specification
Console Standard
# clear

Browser compatibility

BCD tables only load in the browser

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Sep 14, 2021, by MDN contributors

Change your language

Related Topics

  1. Console API
  2. Console
  3. Methods
    1. assert()
    2. clear()
    3. count()
    4. countReset()
    5. debug()
    6. dir()
    7. dirxml()
    8. error()
    9. group()
    10. groupCollapsed()
    11. groupEnd()
    12. info()
    13. log()
    14. profile()
    15. profileEnd()
    16. table()
    17. time()
    18. timeEnd()
    19. timeLog()
    20. timeStamp()
    21. trace()
    22. warn()
  4. Related pages for Console API
    1. Window.console
    2. WorkerGlobalScope.console
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2022 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies