Object. But the main difference is that
Map allows keys of any type.
Here, we use a map object a new Map() and assign it to the maps variable created with let.
After it we use a set method of map object, which allow to save value in maps.
Then we set 3 value in maps object which are “JS”, “Startup”, “JS”
Now, you need to find out. What should be the size of maps object after setting 3 value.
We know new Map() is like an object which allows storing the value of different-different data type and keys also.
So, we use set method 3 times with maps object but “JS” is twice and the new Map() only store unique values. So, “JS” is store only once.
I think you know the answer know.
And last but not the least, don’t forget to like, comment and share. It gives us a morale boost to remain to continue. Also, join our Facebook Page
If you have any question, please feel free to ask me in the comment section and also let me know if you have any suggestions. As suggestions are always welcome.