We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

This translation is incomplete. Please help translate this article from English.

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ó Estat Comentaris
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Set.prototype.clear' in that specification.
Standard Definició inicial.

Compatibilitat amb navegadors

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 38 19.0 (19.0) 11 25 7.1
Característica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic No support 25 19.0 (19.0) No support No support 8

Vegeu també

Document Tags and Contributors

Contributors to this page: SphinxKnight, enTropy
Last updated by: SphinxKnight,