If you do an Array.from(names), you can convert the names Set back to an Array with duplicates removed. Quick way to eliminate duplicates from an Array.
Nice short video on the differences between Set/Array and Map/Object. I wanted to ask what are the purposes of using WeakMap and WeakSet? Only the advantage of garbage collection of the keys, am I right?
That is one of the differences yes. Also, WeakSets are collections of objects only. They cannot contain arbitrary values of any type, like Sets do. With WeakMaps, unlike Maps, the keys are not enumerable.
@@SteveGriffith-Prof3ssorSt3v3 Thx Bro you save my day because I thought .map() which loop the array is same as const map = new map() hhhhh thx so much.. can i ask how can i improve my skills in javascript to become senior developer
The idea using Set to remove duplicate is eye-opening! Thank you very much,.
Very nice explanation, Mr. Griffith!
Another very cool tutorial!
Great explanation as always! Keep it up!
If you do an Array.from(names), you can convert the names Set back to an Array with duplicates removed. Quick way to eliminate duplicates from an Array.
Using a spread operator is a quicker/more modern way to do this
Nice short video on the differences between Set/Array and Map/Object. I wanted to ask what are the purposes of using WeakMap and WeakSet? Only the advantage of garbage collection of the keys, am I right?
That is one of the differences yes. Also, WeakSets are collections of objects only. They cannot contain arbitrary values of any type, like Sets do. With WeakMaps, unlike Maps, the keys are not enumerable.
so what's the point of using maps if maps overwrite the previous data too?, i think maps will be different
thanks man
Thx bro how about map array function ist the same map object what you talk about I'm little confuse hh
Array is a datatype, just like Map and Set are datatypes.
The Array datatype has a method called map. It is not the same as the Map datatype
@@SteveGriffith-Prof3ssorSt3v3 Thx Bro you save my day because I thought .map() which loop the array is same as const map = new map() hhhhh thx so much.. can i ask how can i improve my skills in javascript to become senior developer