--- title: clear() slug: Web/API/Console/clear translation_of: Web/API/Console/clear ---
Vide la console.
Tous les messages de la console seront supprimés et remplacés par un message de confirmation ("Console was cleared").
À noter: sur Google Chrome, console.clear()
n'a aucun effet si l'utilisateur a coché "Preserve log upon navigation" dans les paramètres de l'inspecteur.
console.clear();
Paramètres | Status | Commentaire |
---|---|---|
{{SpecName("Console API", "#clear", "console.clear()")}} | {{Spec2("Console API")}} | Définition Initial |
{{CompatibilityTable}}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Support basique | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("48.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Available in workers | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Support basique | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("48.0")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Available in workers | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |