--- title: WeakMap.prototype slug: conflicting/Web/JavaScript/Reference/Global_Objects/WeakMap tags: - ECMAScript 2015 - JavaScript - Propriété - Reference - WeakMap translation_of: Web/JavaScript/Reference/Global_Objects/WeakMap translation_of_original: Web/JavaScript/Reference/Global_Objects/WeakMap/prototype original_slug: Web/JavaScript/Reference/Objets_globaux/WeakMap/prototype ---
La propriété WeakMap.prototype représente le prototype du constructeur {{jsxref("WeakMap")}}.
Les instances de {{jsxref("WeakMap")}} héritent de {{jsxref("WeakMap.prototype")}}. L'objet prototype du constructeur peut donc être utilisé pour ajouter des propriétés et/ou des méthodes pour toutes les instances de WeakMap.
WeakMap.prototype est un objet ordinaire :
Object.prototype.toString.call(WeakMap.prototype); // "[object Object]"
WeakMap.prototype.constructorclé. WeakMap.prototype.has(clé) renverra false une fois la valeur supprimée.clé, ou undefined s'il n'y en a pas.clé donnée pour l'objet WeakMap.clé dans l'objet WeakMap. La méthode renvoie l'objet WeakMap.WeakMap. Il est possible de construire un objet semblable à WeakMap qui possède une méthode clear() en encapsulant (cf. l'exemple sur la page {{jsxref("WeakMap")}}).| Spécification | État | Commentaires |
|---|---|---|
| {{SpecName('ES2015', '#sec-weakmap.prototype', 'WeakMap.prototype')}} | {{Spec2('ES2015')}} | Définition initiale. |
| {{SpecName('ESDraft', '#sec-weakmap.prototype', 'WeakMap.prototype')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.WeakMap.prototype")}}