From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/weakset/add/index.html | 103 +++++++++++ .../global_objects/weakset/clear/index.html | 87 +++++++++ .../global_objects/weakset/delete/index.html | 112 ++++++++++++ .../global_objects/weakset/has/index.html | 113 ++++++++++++ .../reference/global_objects/weakset/index.html | 201 +++++++++++++++++++++ .../global_objects/weakset/prototype/index.html | 131 ++++++++++++++ 6 files changed, 747 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/add/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/clear/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/delete/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/has/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/index.html create mode 100644 files/ca/web/javascript/reference/global_objects/weakset/prototype/index.html (limited to 'files/ca/web/javascript/reference/global_objects/weakset') 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 +--- +
{{JSRef}}
+ +

El mètode add() afegeix un nou objecte al final d'un objecte WeakSet.

+ +

Sintaxi

+ +
ws.add(value);
+ +

Paràmetres

+ +
+
value
+
Necessari. L'objecte que es vol afegir a la col·lecció de WeakSet.
+
+ +

Utilitzar el mètode add

+ +
var ws = new WeakSet();
+
+ws.add(window); // afegeix l'objecte window al WeakSet
+
+ws.has(window); // true
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-weakset.prototype.add', 'WeakSet.prototype.add')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic36{{CompatGeckoDesktop(34)}}{{CompatNo}}23{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/weakset/clear/index.html b/files/ca/web/javascript/reference/global_objects/weakset/clear/index.html new file mode 100644 index 0000000000..4e6b2e6f8c --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/clear/index.html @@ -0,0 +1,87 @@ +--- +title: WeakSet.prototype.clear() +slug: Web/JavaScript/Reference/Global_Objects/WeakSet/clear +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/clear +--- +
{{JSRef}} {{obsolete_header}}
+ +

El mètode clear() elimina tots els elements d'un objecte WeakSet.

+ +

Sintaxi

+ +
ws.clear();
+ +

Exemples

+ +

Utilitzar el mètode clear

+ +
var ws = new WeakSet();
+
+ws.add(window);
+ws.has(window);  // true
+
+ws.clear();
+
+ws.has(window); // false
+
+ +

Especificacions

+ +

No forma part de cap especificació actual o borrador. Aquest mètode formava part del borrador de l'especificació d'ECMAScript 6 fins la revisió 28 (versió del 14 d'octubre del 2014), però s'ha eliminat en versions posteriors del borrador. No formarà part de l'estàndard final.

+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic36{{CompatGeckoDesktop(34)}}{{CompatNo}}23{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{CompatGeckoMobile(34)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/weakset/delete/index.html b/files/ca/web/javascript/reference/global_objects/weakset/delete/index.html new file mode 100644 index 0000000000..9bfaa0f439 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/delete/index.html @@ -0,0 +1,112 @@ +--- +title: WeakSet.prototype.delete() +slug: Web/JavaScript/Reference/Global_Objects/WeakSet/delete +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/delete +--- +
{{JSRef}}
+ +

El mètode delete()elimina l'element especificat de l'objecte WeakSet.

+ +

Sintaxi

+ +
ws.delete(value);
+ +

Paràmetres

+ +
+
value
+
Necessari. L'objecte que es vol eliminar de l'objecte WeakSet.
+
+ +

Return value

+ +

Retorna true si l'element dins l'objecte WeakSet s'ha eliminat satisfactòriament; Del cas contrari retornarà false.

+ +

Exemples

+ +

Utilitzar el mètode delete

+ +
var ws = new WeakSet();
+var obj = {};
+
+ws.add(window);
+
+ws.delete(obj);    // Retorna false. No s'ha trobat cap obj per eliminar.
+ws.delete(window); // Retorna true.  Eliminat satisfactòriament.
+
+ws.has(window);    // Retorna false. window ja no és present en WeakSet.
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-weakset.prototype.delete', 'WeakSet.prototype.delete')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic36{{CompatGeckoDesktop(34)}}{{CompatNo}}23{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/weakset/has/index.html b/files/ca/web/javascript/reference/global_objects/weakset/has/index.html new file mode 100644 index 0000000000..b2074a9847 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/has/index.html @@ -0,0 +1,113 @@ +--- +title: WeakSet.prototype.has() +slug: Web/JavaScript/Reference/Global_Objects/WeakSet/has +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/has +--- +
{{JSRef}}
+ +

El mètode has() retorna un booleà indicant si un objecte existeix o no en unmethod returns a boolean indicating whether an object exists in a WeakSet or not.

+ +

Sintaxi

+ +
ws.has(valor);
+ +

Paràmetres

+ +
+
valor
+
Necessari. L'objecte a comprovar la seva presència en WeakSet.
+
+ +

Valor de retorn

+ +
+
Booleà
+
Retorna true si un element amb el valor especificat existeix en l'objecte WeakSet; en el cas contrari retornarà false.
+
+ +

Exemples

+ +

Utilitzar el mètode has

+ +
var ws = new WeakSet();
+var obj = {};
+ws.add(window);
+
+mySet.has(window);  // retorna true
+mySet.has(obj);     // retorna false
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-weakset.prototype.has', 'WeakSet.prototype.has')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic36{{CompatGeckoDesktop(34)}}{{CompatNo}}23{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/weakset/index.html b/files/ca/web/javascript/reference/global_objects/weakset/index.html new file mode 100644 index 0000000000..d1ae3999a6 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/index.html @@ -0,0 +1,201 @@ +--- +title: WeakSet +slug: Web/JavaScript/Reference/Global_Objects/WeakSet +tags: + - ECMAScript6 + - Experimental + - JavaScript + - NeedsTranslation + - TopicStub + - WeakSet +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet +--- +
{{JSRef}}
+ +

L'objecte WeakSet permet emmagatzemar dèbilment objects en una col·lecció.

+ +

Sintaxi

+ +
 new WeakSet([iterable]);
+ +

Paràmetres

+ +
+
iterable
+
Si es pasa un objecte iterable, tots els seus elements seràn afegits al nou WeakSet. null es tractat com a undefined.
+
+ +

Descripció

+ +

Els objectes WeakSet són col·leccions d'objectes. Un objecte al WeakSet només pot passar un cop, és únic en la col·lecció de WeakSet.

+ +

Les principals diferències respecte l'objecte {{jsxref("Set")}} són:

+ + + +

Propietats

+ +
+
WeakSet.length
+
El valor de la propietat length és 0.
+
{{jsxref("WeakSet.prototype")}}
+
Representa el prototip per al constructor de Set. Permet afegir propietats a tots els objectes WeakSet.
+
+ +

Instàncies WeakSet

+ +

Totes les instàncies WeakSet hereten de {{jsxref("WeakSet.prototype")}}.

+ +

Propietats

+ +

{{page('en-US/Web/JavaScript/Reference/Global_Objects/WeakSet/prototype','Properties')}}

+ +

Mètodes

+ +

{{page('en-US/Web/JavaScript/Reference/Global_Objects/WeakSet/prototype','Methods')}}

+ +

Exemples

+ +

Utilitzar l'objecte WeakSet

+ +
var ws = new WeakSet();
+var obj = {};
+var foo = {};
+
+ws.add(window);
+ws.add(obj);
+
+ws.has(window); // true
+ws.has(foo);    // false, foo no s'ha afegit al conjunt
+
+ws.delete(window); // elimina window del conjunt
+ws.has(window);    // false, window ha sigut eliminat
+
+ws.clear(); // buida tot el WeakSet
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-weakset-objects', 'WeakSet')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatChrome(36)}}{{ CompatGeckoDesktop(34) }}{{CompatNo}}{{ CompatOpera(23) }}9
new WeakSet(iterable)38{{ CompatGeckoDesktop(34) }}{{CompatNo}}259
Constructor argument: new WeakSet(null){{CompatVersionUnknown}}{{CompatGeckoDesktop("37")}}{{CompatUnknown}}{{CompatUnknown}}9
Monkey-patched add() in Constructor{{CompatVersionUnknown}}{{CompatGeckoDesktop("37")}}{{CompatUnknown}}{{CompatUnknown}}9
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}9
new WeakMap(iterable){{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}9
Constructor argument: new WeakSet(null){{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}9
Monkey-patched add() in Constructor{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}9
+
+ +

Vegeu també

+ + diff --git a/files/ca/web/javascript/reference/global_objects/weakset/prototype/index.html b/files/ca/web/javascript/reference/global_objects/weakset/prototype/index.html new file mode 100644 index 0000000000..2b4cd51048 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/weakset/prototype/index.html @@ -0,0 +1,131 @@ +--- +title: WeakSet.prototype +slug: Web/JavaScript/Reference/Global_Objects/WeakSet/prototype +translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet +--- +
{{JSRef}}
+ +

La propietat WeakSet.prototype representa el prototip pel constructor {{jsxref("WeakSet")}}.

+ +
{{js_property_attributes(0,0,0)}}
+ +

Descripció

+ +

Les instàncies {{jsxref("WeakSet")}} hereten de {{jsxref("WeakSet.prototype")}}. Es pot utilitzar l'objecte prototip del constructor per afegir propietats o mètodes a totes les instàncies WeakSet.

+ +

WeakSet.prototype és en si mateix només un objecte ordinari

+ +
Object.prototype.toString.call(WeakSet.prototype); // "[object Object]"
+ +

Propietats

+ +
+
WeakSet.prototype.constructor
+
Retorna la funció que ha creat un prototip de la instància. Aquesta és la funció {{jsxref("WeakSet")}} per defecte.
+
+ +

Mètodes

+ +
+
{{jsxref("WeakSet.add", "WeakSet.prototype.add(value)")}}
+
Afegeix un nou element amb el valor donat a l'objecte WeakSet.
+
{{jsxref("WeakSet.delete", "WeakSet.prototype.delete(value)")}}
+
Elimina l'element associat al value. WeakSet.prototype.has(value) retornarà després false.
+
{{jsxref("WeakSet.has", "WeakSet.prototype.has(value)")}}
+
Retorna un booleà afirmant si un element és o no present amb el valor donat en l'objecte WeakSet.
+
{{jsxref("WeakSet.prototype.clear()")}} {{obsolete_inline}}
+
Elimina tots els elements de l'objecte WeakSet.
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-weakset.prototype', 'WeakSet.prototype')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic36{{ CompatGeckoDesktop(34) }}{{CompatNo}}23{{CompatNo}}
Objecte ordinari{{CompatUnknown}}{{CompatGeckoDesktop("40")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracterísticaChrome per AndroidAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile(34) }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
Objecte ordinari{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("40")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

Vegeu també

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