Ques 1
Explain the 'WeakMap' and 'WeakSet' data structures in ES6.
WeakMap and WeakSet are similar to Map and Set, respectively, but they allow for garbage collection of keys and values that are not used elsewhere.
Example:
let weakMap = new WeakMap(); let obj = {}; weakMap.set(obj, 'some value');
복습용 저장
복습용 저장
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
도움이 되었나요?
Add Comment
View Comments