The Differences between ES6 Maps and Sets

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 13

  • @rotrose7531
    @rotrose7531 4 роки тому +5

    The idea using Set to remove duplicate is eye-opening! Thank you very much,.

  • @zeonleonel4684
    @zeonleonel4684 6 років тому

    Very nice explanation, Mr. Griffith!

  • @chesterxp508
    @chesterxp508 3 роки тому +1

    Another very cool tutorial!

  • @LeetCodeSimplified
    @LeetCodeSimplified 2 роки тому

    Great explanation as always! Keep it up!

  • @rutwickgangurde3247
    @rutwickgangurde3247 3 роки тому

    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.

    • @reportaccounthcc2463
      @reportaccounthcc2463 2 роки тому +1

      Using a spread operator is a quicker/more modern way to do this

  • @rungekutta5732
    @rungekutta5732 4 роки тому

    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?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 роки тому

      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.

  • @muhamadizranovan1653
    @muhamadizranovan1653 Рік тому

    so what's the point of using maps if maps overwrite the previous data too?, i think maps will be different

  • @jacksonvinicius299
    @jacksonvinicius299 Рік тому

    thanks man

  • @ProgrammingWithOsku
    @ProgrammingWithOsku 3 роки тому

    Thx bro how about map array function ist the same map object what you talk about I'm little confuse hh

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому +2

      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

    • @ProgrammingWithOsku
      @ProgrammingWithOsku 3 роки тому

      @@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