C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript WeakSet delete() methodThe JavaScript WeakSet delete() method is used to remove the specified object from WeakSet object. SyntaxThe delete() method is represented by the following syntax: WeakSetObj.delete() JavaScript WeakSet delete() method exampleLet's see an example to delete the specified elements from the WeakSet object. <script> var ws = new WeakSet(); var obj={}; ws.add(obj); document.writeln("Element present before invoking delete() method: "+ws.has(obj)+"<br>"); ws.delete(obj); document.writeln("Element present before invoking delete() method: "+ws.has(obj)); </script> Output: Element present before invoking delete() method: true Element present after invoking delete() method: false
Next TopicWeakSet has() Method
|