Converting Array-like Objects to Arrays

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

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

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

    Your channel provides tons of invaluable stuff of javascript, I found it only recently. Please do not stop. Many people want to know JS in depth and we can rarely find great stuff like this. Thank you.

  • @Mostafa-jh2ij
    @Mostafa-jh2ij 8 หลายเดือนก่อน

    Sir, I'm just starting out with Web Dev, and your content is so helpful. I really appreciate it!

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

    Awesome tutorial!

  • @lenhu7089
    @lenhu7089 4 ปีที่แล้ว

    thank you

  • @Albertmars32
    @Albertmars32 6 ปีที่แล้ว

    var oki = new Array(6)
    undefined
    oki
    (6) [empty × 6]
    length: 6
    __proto__: Array(0)
    var okii = Array.from({lenght:7})
    undefined
    okii
    [ ]
    length: 0
    __proto__: Array(0)
    mine doesnt appear undefined undefined undefined it just appears as an empty array

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

      There was a misspelling with the length property in the object. Array.from looks for a length property. Since it was misspelled it didn't find it.

    • @frank3481
      @frank3481 5 ปีที่แล้ว

      Try again. It works just fine for me.
      okii;
      (7) [undefined, undefined, undefined, undefined, undefined, undefined, undefined]
      0: undefined
      1: undefined
      2: undefined
      3: undefined
      4: undefined
      5: undefined
      6: undefined
      length: 7
      __proto__: Array(0)