![]() |
In JavaScript, the Set constructor is used to create a new Set object. A Set is a built-in object in JavaScript that allows you to store unique values, whether they are primitive values or object references. The Set constructor is called with the Syntax:let mySet = new Set([iterable]);
Parameters:
Example: In this example, we will see that the set takes only a unique value. Javascript
Output
Set(4) { 'California', 'India', 10, { a: 5 } } |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |