Kronologi Togel Online

Judi Toto gelap online atau yang biasa dikenal asalkan nama Togel online ini Batman365 pecah populer dari kalangan manapun. Dengan deretan jaman yang sangat pesat ini banyak melindungi pemain judi…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What is Set and Map in JavaScript ?

Set is an object that lets you store unique values of any data type , the value in a set can only occur once that means it has to be unique.

This is how you create a set with the help of constructer :

the Set has multiple methods associated with it like add , clear , delete, has etc.

below is the the example of add()

here printing mySet object will give you the output :

Note: 2 was only added once as Set() stores only unique values.

similarly .has method would print true as it’s present in the object ie mySet.

Map is also an object similar to Set but it allows you to save date with key — value pairs , you can store any type of data (string , number , object), it also remembers insertion order of the data too.

This is how you create a Map with the help of constructer :

Map also has many methods like get , has , delete etc

The above code will print value of ‘a’ which is 1.

The above code will print the size of the objects like how may key value pairs are there in the object.

Below is a code snippet of an array within an array being inserted into Map object and creating an object with key value pairs with the help of loop.

Add a comment

Related posts:

Cosa intendiamo quando parliamo di dati

Partiamo subito da una constatazione: oggi nel digitale è impossibile fare marketing senza tecnologia. In Webranking questo lo sappiamo bene e, intuendo in anticipo le potenzialità della tecnologia…

The Top 10 Natural Superfoods on Earth

You deserve to have the correct information to help you figure out how to infuse extra nutrition into your diet. Whether your goal is just to learn where the most manageable switches are, or you…

K2 LIQUID SPRAY

BUY K2 LIQUID SPRAY ONLINE. “K2 LIQUID SPRAY” is published by Larrymedium.