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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
clearChrome Full support 25Edge Full support 12Firefox Full support 39IE Full support 8Opera Full support 12Safari Full support 6.1WebView Android Full support ≤37Chrome Android Full support 25Firefox Android Full support 39Opera Android Full support 12Safari iOS Full support 7Samsung Internet Android Full support 1.5

Legend

Full support  
Full support