Javascript Set - Is It Better Than Array?

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 21

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  3 หลายเดือนก่อน

    WATCH NEXT: Javascript Interview Questions and Answers - Dominate Your Next Interview - th-cam.com/video/wnYKH2dO620/w-d-xo.htmlsi=5DfbGEfhXWiiv0a_

  • @gunman479
    @gunman479 ปีที่แล้ว +4

    Thanks for this. I find Set very useful for removing duplicates in existing arrays.

  • @burningtree878
    @burningtree878 ปีที่แล้ว

    In my experience I always go with arrays too because of exactly what you said, all of the super helpful methods on the array. I know sets have their place but it’s almost like I’m working in binary code compared to the array.

  • @sinaebr7337
    @sinaebr7337 ปีที่แล้ว +1

    I think word of "List" is much suitable for "[]"
    classes like "Int8Array" are much more for word of "Array"

  • @BrUSomania
    @BrUSomania ปีที่แล้ว +1

    Sets work great if you need to store IDs (which need to be unique).

  • @quanghungpham269
    @quanghungpham269 ปีที่แล้ว

    The only benefit that set has is the unique value which is very helpful at some points because in arrays, it's very hard to do it, usually I have to loop through an array or create another comparison array just to do it. Set makes this problem much easier.

  • @MrKyriakos32
    @MrKyriakos32 4 หลายเดือนก่อน

    the only real value of sets in my knowledge is to incorporate a reverse index algorithm and use sets for the reversed index of the objects, since you want in such case every value to be unique and store inside it the id of the object

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน

      Yeap. Sets application is super narrow and rarely needed.

  • @val-do
    @val-do ปีที่แล้ว +2

    I'm first here :)

  • @kibem.c
    @kibem.c ปีที่แล้ว +1

    I'm third here :)

  • @Guess_who08
    @Guess_who08 ปีที่แล้ว

    I’m at 3

  • @igorr4682
    @igorr4682 ปีที่แล้ว +1

    Fyi: taking a breath between sentences is completely acceptable and can even be beneficial for communication clarity and overall delivery.

    • @gunman479
      @gunman479 ปีที่แล้ว +2

      Yeah, if you enjoy watching 30+ min videos. I much prefer the fast paced approach. I'm sure others appreciate it too.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  ปีที่แล้ว +4

      Exactly. I'm trying to minimize unnecessary time

    • @jonathanjohnson2785
      @jonathanjohnson2785 ปีที่แล้ว

      ​@@MonsterlessonsAcademy😂😂😅 great comeback

  • @harvey_04
    @harvey_04 ปีที่แล้ว +1

    I'm second here :)