이 번역은 완료되지 않았습니다. 이 문서를 번역해 주세요.

 

delete() 메소드는 WeakMap 객체의 특정 요소를 제거합니다.

문법

wm.delete(key);

Parameters

key
필수 사항. WeakMap 객체에서 제거 할 요소의 키입니다.

Return value

WeakMap 객체의 요소가 성공적으로 제거되면 true입니다. WeakMap에서 키를 찾을 수 없거나 키가 객체가 아닌 경우 false.

Examples

Using the delete method

var wm = new WeakMap();
wm.set(window, 'foo');

wm.delete(window); // Returns true. Successfully removed.

wm.has(window);    // Returns false. The window object is no longer in the WeakMap.

Specifications

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'WeakMap.prototype.delete' in that specification.
Standard Initial definition.
ECMAScript Latest Draft (ECMA-262)
The definition of 'WeakMap.prototype.delete' in that specification.
Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung InternetNode.js
Basic supportChrome Full support 36Edge Full support YesFirefox Full support 6
Notes
Full support 6
Notes
Notes Prior to Firefox 38, this method threw a TypeError when the key parameter was not an object. This has been fixed in version 38 and later to return false as per the ES2015 standard.
IE Full support 11Opera Full support 23Safari Full support 8WebView Android Full support 37Chrome Android Full support 36Edge Mobile Full support YesFirefox Android Full support 6
Notes
Full support 6
Notes
Notes Prior to Firefox 38, this method threw a TypeError when the key parameter was not an object. This has been fixed in version 38 and later to return false as per the ES2015 standard.
Opera Android Full support 23Safari iOS Full support 8Samsung Internet Android Full support Yesnodejs Full support 0.12
Full support 0.12
Full support 0.10
Disabled
Disabled From version 0.10: this feature is behind the --harmony runtime flag.

Legend

Full support  
Full support
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: limkukhyun, Seok.Heo
최종 변경자: limkukhyun,