aboutsummaryrefslogtreecommitdiff
path: root/files/fr/conflicting/web/javascript/reference/global_objects/weakset/index.html
blob: 092f97b6c39866d4ae10b87a2d5c11bd7291b955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: WeakSet.prototype
slug: Web/JavaScript/Reference/Objets_globaux/WeakSet/prototype
tags:
  - ECMAScript 2015
  - JavaScript
  - Propriété
  - Reference
  - WeakSet
translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet
translation_of_original: Web/JavaScript/Reference/Global_Objects/WeakSet/prototype
---
<div>{{JSRef}}</div>

<p>La propriété <code><strong>WeakSet</strong></code><strong><code>.prototype</code></strong> représente le prototype du constructeur {{jsxref("WeakSet")}}.</p>

<div>{{js_property_attributes(0,0,0)}}</div>

<h2 id="Description">Description</h2>

<p>Toutes les instances de {{jsxref("WeakSet")}} héritent de {{jsxref("WeakSet.prototype")}}. Le prototype du constructeur peut être utilisé pour ajouter des méthodes et/ou des propriétés à toutes les instances de <code>WeakSet</code>.</p>

<p>WeakSet.prototype est un objet ordinaire :</p>

<pre class="brush: js">Object.prototype.toString.call(WeakSet.prototype); // "[object Object]"</pre>

<h2 id="Propriétés">Propriétés</h2>

<dl>
 <dt><code>WeakSet.prototype.constructor</code></dt>
 <dd>Cette propriété renvoie la fonction qui a créé le prototype de l'instance. Par défaut, ce sera la fonction native {{jsxref("WeakSet")}}.</dd>
</dl>

<h2 id="Méthodes">Méthodes</h2>

<dl>
 <dt>{{jsxref("WeakSet.add", "WeakSet.prototype.add(valeur)")}}</dt>
 <dd>Cette méthode permet d'ajouter une nouvel objet avec une valeur donnée à l'objet <code>WeakSet</code>.</dd>
 <dt>{{jsxref("WeakSet.delete", "WeakSet.prototype.delete(valeur)")}}</dt>
 <dd>Cette méthode retire l'élément associé à <code>valeur</code>. <code>WeakSet.prototype.has(valeur)</code> renverra <code>false</code> une fois l'opération effectuée.</dd>
 <dt>{{jsxref("WeakSet.has", "WeakSet.prototype.has(valeur)")}}</dt>
 <dd>Cette méthode renvoie un booléen indiquant si oui ou non un élément est présent avec cette valeur au sein de l'objet <code>WeakSet</code>.</dd>
 <dt><s class="obsoleteElement">{{jsxref("WeakSet.prototype.clear()")}}{{obsolete_inline}}</s></dt>
 <dd><s class="obsoleteElement">Cette méthode retire tous les éléments de l'ensemble <code>WeakSet</code>.</s></dd>
</dl>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">État</th>
   <th scope="col">Commentaires</th>
  </tr>
  <tr>
   <td>{{SpecName('ES2015', '#sec-weakset.prototype', 'WeakSet.prototype')}}</td>
   <td>{{Spec2('ES2015')}}</td>
   <td>Définition initiale.</td>
  </tr>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-weakset.prototype', 'WeakSet.prototype')}}</td>
   <td>{{Spec2('ESDraft')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<div class="hidden">Ce tableau de compatibilité a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</div>

<p>{{Compat("javascript.builtins.WeakSet.prototype")}}</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li>{{jsxref("Set.prototype")}}</li>
 <li>{{jsxref("WeakMap.prototype")}}</li>
</ul>