TheDeveloperBlog.com

Home | Contact Us

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

JavaScript Set

JavaScript Set with example, clear() method, javascript set methods, delete() method, entries() method, foreach() method, has() method, values() method etc.

<< Back to JAVASCRIPT

JavaScript Set Object

The JavaScript Set object is used to store the elements with unique values. The values can be of any type i.e. whether primitive values or object references.

Syntax

new Set([iterable])

Parameter

iterable - It represents an iterable object whose elements will be added to the new Set.

Points to remember

  • A set object uses the concept of keys internally.
  • A set object cannot contain the duplicate values.
  • A set object iterates its elements in insertion order.

JavaScript Set Methods

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

Methods Description
add() It adds the specified values to the Set object.
clear() It removes all the elements from the Set object.
delete() It deletes the specified element from the Set object.
entries() It returns an object of Set iterator that contains an array of [value, value] for each element.
forEach() It executes the specified function once for each value.
has() It indicates whether the Set object contains the specified value element.
values() It returns an object of Set iterator that contains the values for each element.

Next TopicJavaScript Map




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