From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../global_objects/weakmap/has/index.html | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/weakmap/has/index.html (limited to 'files/fr/web/javascript/reference/global_objects/weakmap/has/index.html') diff --git a/files/fr/web/javascript/reference/global_objects/weakmap/has/index.html b/files/fr/web/javascript/reference/global_objects/weakmap/has/index.html new file mode 100644 index 0000000000..6499d58bb7 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/weakmap/has/index.html @@ -0,0 +1,79 @@ +--- +title: WeakMap.prototype.has() +slug: Web/JavaScript/Reference/Objets_globaux/WeakMap/has +tags: + - ECMAScript 2015 + - JavaScript + - Méthode + - Prototype + - Reference + - WeakMap +translation_of: Web/JavaScript/Reference/Global_Objects/WeakMap/has +--- +
{{JSRef}}
+ +

La méthode has() renvoie un booléen qui indique s'il existe (ou non) un élément avec une clé donnée au sein de l'objet WeakMap.

+ +
{{EmbedInteractiveExample("pages/js/weakmap-prototype-has.html")}}
+ + + +

Syntaxe

+ +
wm.has(clé);
+ +

Paramètre

+ +
+
clé
+
Ce paramètre est obligatoire. Il correspond à la clé de l'élément dont on souhaite savoir s'il est présent dans l'objet WeakMap.
+
+ +

Valeur de retour

+ +

La méthode renvoie true s'il existe un élément du WeakMap avec la clé donné, false sinon.

+ +

Exemples

+ +
var wm = new WeakMap();
+wm.set(window, "toto");
+
+wm.has(window); // renvoie true
+wm.has("machin");  // renvoie false
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES2015', '#sec-weakmap.prototype.has', 'WeakMap.prototype.has')}}{{Spec2('ES2015')}}Définition initiale.
{{SpecName('ESDraft', '#sec-weakmap.prototype.has', 'WeakMap.prototype.has')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.builtins.WeakMap.has")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf