• Skip to main content
  • Skip to search
    • 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 Status Comment
Console API
The definition of 'console.clear()' in that specification.
Living Standard Initial definition

Browser compatibility

BCD tables only load in the browser

Found a problem with this page?

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

Last modified: Feb 19, 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. This API has not been standardized. profile()
    15. This API has not been standardized. profileEnd()
    16. table()
    17. time()
    18. timeEnd()
    19. timeLog()
    20. This API has not been standardized. 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

Mozilla

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

  • Terms
  • Privacy
  • Cookies