From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../objectes_globals/set/clear/index.html | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 files/ca/web/javascript/referencia/objectes_globals/set/clear/index.html (limited to 'files/ca/web/javascript/referencia/objectes_globals/set/clear/index.html') diff --git a/files/ca/web/javascript/referencia/objectes_globals/set/clear/index.html b/files/ca/web/javascript/referencia/objectes_globals/set/clear/index.html new file mode 100644 index 0000000000..6ef179daaa --- /dev/null +++ b/files/ca/web/javascript/referencia/objectes_globals/set/clear/index.html @@ -0,0 +1,105 @@ +--- +title: Set.prototype.clear() +slug: Web/JavaScript/Referencia/Objectes_globals/Set/clear +translation_of: Web/JavaScript/Reference/Global_Objects/Set/clear +--- +
{{JSRef}}
+ +

El mètode clear() esborra tots els elements emmagatzemats dins l'objecte Set.

+ +

Sintaxi

+ +
mySet.clear();
+ +

Exemples

+ +

Utilitzar el mètode clear

+ +
var mySet = new Set();
+mySet.add(1);
+mySet.add("foo");
+
+mySet.size;       // 2
+mySet.has("foo"); // true
+
+mySet.clear();
+
+mySet.size;       // 0
+mySet.has("bar")  // false
+
+ +

Especificacions

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

Compatibilitat amb navegadors

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic38{{CompatGeckoDesktop("19.0")}}11257.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}25{{CompatGeckoMobile("19.0")}}{{CompatNo}}{{CompatNo}}8
+
+ +

Vegeu també

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