Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WeakSet.prototype.clear()

This article needs an editorial review. How you can help.

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

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

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 36 34 (34) Not supported 23 Not supported
Característica Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic Not supported 34.0 (34) Not supported Not supported Not supported

Vegeu també

Document Tags and Contributors

 Contributors to this page: llue
 Last updated by: llue,