diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
| commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
| tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/ca/web/javascript/reference/global_objects/weakset/add | |
| parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
| download | translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2 translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip | |
initial commit
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/weakset/add')
| -rw-r--r-- | files/ca/web/javascript/reference/global_objects/weakset/add/index.html | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/weakset/add/index.html b/files/ca/web/javascript/reference/global_objects/weakset/add/index.html new file mode 100644 index 0000000000..983b24329a --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/add/index.html @@ -0,0 +1,103 @@ +--- +title: WeakSet.prototype.add() +slug: Web/JavaScript/Reference/Global_Objects/WeakSet/add +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/add +--- +<div>{{JSRef}}</div> + +<p>El mètode <code><strong>add()</strong></code> afegeix un nou objecte al final d'un objecte <code>WeakSet</code>.</p> + +<h2 id="Sintaxi">Sintaxi</h2> + +<pre class="syntaxbox"><code><em>ws</em>.add(value);</code></pre> + +<h3 id="Paràmetres">Paràmetres</h3> + +<dl> + <dt>value</dt> + <dd>Necessari. L'objecte que es vol afegir a la col·lecció de <code>WeakSet.</code></dd> +</dl> + +<h2 id="Utilitzar_el_mètode_add">Utilitzar el mètode <code>add</code></h2> + +<pre class="brush: js">var ws = new WeakSet(); + +ws.add(window); // afegeix l'objecte window al WeakSet + +ws.has(window); // true +</pre> + +<h2 id="Especificacions">Especificacions</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificació</th> + <th scope="col">Estat</th> + <th scope="col">Comentaris</th> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-weakset.prototype.add', 'WeakSet.prototype.add')}}</td> + <td>{{Spec2('ES6')}}</td> + <td>Definició inicial.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Suport bàsic</td> + <td>36</td> + <td>{{CompatGeckoDesktop(34)}}</td> + <td>{{CompatNo}}</td> + <td>23</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Característica</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Suport bàsic</td> + <td>{{CompatNo}}</td> + <td>{{ CompatGeckoMobile(34) }}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="Vegeu_també">Vegeu també</h2> + +<ul> + <li>{{jsxref("WeakSet")}}</li> + <li>{{jsxref("WeakSet.prototype.delete()")}}</li> + <li>{{jsxref("WeakSet.prototype.has()")}}</li> +</ul> |
