Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

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.

The clear() method used to remove all elements from a WeakSet object, but is no longer part of ECMAScript and its implementations.




Using the clear method

var ws = new WeakSet();

ws.has(window);  // true


ws.has(window); // false


Not part of any current specification or draft. The method was planned for inclusion in ECMAScript 6, but dropped from the draft specification in revision 28 (October 14, 2014). Browser support for the feature was subsequently removed, and it never became part of the final standard.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support36 — 43 No34 — 46 No25 — 30 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support36 — 4336 — 43 No34 — 4625 — 30 No Yes

See also

Etiquetas do documento e colaboradores

 Colaboradores desta página: fscholz, Alhadis, claudepache, realityking, teoli
 Última atualização por: fscholz,