TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript WeakSet

JavaScript WeakSet Method with example, WeakSet objects are collections of objects. An object in the WeakSet occurs once in the WeakSet collection, javascript weakset add() method, javascript weakset delete() method, javascript weakset has() method etc.

<< Back to JAVASCRIPT

JavaScript WeakSet Object

The JavaScript WeakSet object is the type of collection that allows us to store weakly held objects. Unlike Set, the WeakSet are the collections of objects only. It doesn't contain the arbitrary values.

Syntax

new WeakSet([iterable])

Parameter

iterable - It represents the iterable object whose elements will be added to a new WeakSet.

Points to remember

  • A WeakSet object contains unique objects only.
  • In WeakSet, if there is no reference to a stored object, they are targeted to garbage collection.
  • In WeakSet, the objects are not enumerable. So, it doesn't provide any method to get the specified objects.

JavaScript WeakSet Methods

Let's see the list of JavaScript WeakSet methods with their description.

Methods Description
add() It adds a new object to the end of WeakSet object.
delete() It removes the specified object from the WeakSet object.
has() It indicates whether the WeakSet object contains the specified object element.

Next TopicJavaScript WeakMap




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf