From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../reference/global_objects/set/clear/index.md | 70 +++++++++------------- 1 file changed, 27 insertions(+), 43 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/set/clear') diff --git a/files/fr/web/javascript/reference/global_objects/set/clear/index.md b/files/fr/web/javascript/reference/global_objects/set/clear/index.md index a82d07fca4..9a5be9a488 100644 --- a/files/fr/web/javascript/reference/global_objects/set/clear/index.md +++ b/files/fr/web/javascript/reference/global_objects/set/clear/index.md @@ -11,23 +11,24 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Set/clear original_slug: Web/JavaScript/Reference/Objets_globaux/Set/clear --- -
{{JSRef}}
+{{JSRef}} -

La méthode clear() permet de retirer tous les éléments d'un ensemble Set.

+La méthode **`clear()`** permet de retirer tous les éléments d'un ensemble `Set`. -
{{EmbedInteractiveExample("pages/js/set-prototype-clear.html")}}
+{{EmbedInteractiveExample("pages/js/set-prototype-clear.html")}} -

Syntaxe

+## Syntaxe -
monSet.clear();
+ monSet.clear(); -

Valeur de retour

+### Valeur de retour -

{{jsxref("undefined")}}.

+{{jsxref("undefined")}}. -

Exemples

+## Exemples -
var monSet = new Set();
+```js
+var monSet = new Set();
 monSet.add(1);
 monSet.add("toto");
 
@@ -38,37 +39,20 @@ monSet.clear();
 
 monSet.size;       // 0
 monSet.has("truc")  // false
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES2015', '#sec-set.prototype.clear', 'Set.prototype.clear')}}{{Spec2('ES2015')}}Définition initiale.
{{SpecName('ESDraft', '#sec-set.prototype.clear', 'Set.prototype.clear')}}{{Spec2('ESDraft')}} 
- -

Compatibilité des navigateurs

- -

{{Compat("javascript.builtins.Set.clear")}}

- -

Voir aussi

- - +``` + +## Spécifications + +| Spécification | État | Commentaires | +| ---------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------- | +| {{SpecName('ES2015', '#sec-set.prototype.clear', 'Set.prototype.clear')}} | {{Spec2('ES2015')}} | Définition initiale. | +| {{SpecName('ESDraft', '#sec-set.prototype.clear', 'Set.prototype.clear')}} | {{Spec2('ESDraft')}} |   | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.Set.clear")}} + +### Voir aussi + +- {{jsxref("Set")}} +- {{jsxref("Set.prototype.delete()")}} -- cgit v1.2.3-54-g00ecf