이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!
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.
The clear()
method used to remove all elements from a WeakSet
object, but is no longer part of ECMAScript and its implementations.
Syntax
ws.clear();
Examples
Using the clear
method
var ws = new WeakSet(); ws.add(window); ws.has(window); // true ws.clear(); ws.has(window); // false
Specifications
Not part of any current specification or draft. This method was part of the ECMAScript 6 draft specification until revision 28 (version of October 14, 2014), but has been removed in later versions of the draft. It will not be part of the final standard.
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 36 | No support [1] | No support | 23 | No support |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | No support | No support [1] | No support | No support | No support |
[1] The clear()
method has been supported from version 34 until version 45 (including).