Some Array destructuring tricks.

Поділитися
Вставка

КОМЕНТАРІ • 17

  • @dv_interval42
    @dv_interval42 Рік тому +2

    "[They] were so preoccupied with whether or not they could that they didn't stop to think if they should."

  • @richardrisner921
    @richardrisner921 Рік тому +2

    I think that's elegant. You have one paradigm. You can conceptualize a JavaScript object as an array or as a dictionary or as a list, and you can just use one set of common syntax to manipulate any kind of object. Why waste time learning three different kinds of syntax to manipulate what is fundamentally the same kind of thing to the computer? If you need the performance of actually using a different kind of data structure, JavaScript probably isn't the tool you need for the job you are trying to do.

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

    definitely gonna use the last one.. finding the middle of an array.

  • @meetmeer
    @meetmeer Рік тому +2

    Please keep uploading my aWESome man

    • @WesBos
      @WesBos  Рік тому +2

      That's the plan!

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

    Nice!

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

    i love it

  • @r-i-ch
    @r-i-ch Рік тому

    On the one-hand, *cool*.
    On the other - This would be a nightmare to read and make sense of X-P

  • @dazecm
    @dazecm Рік тому +1

    Sorcery! 🙂

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

    Wow 😳😳

  • @christian-schubert
    @christian-schubert Рік тому

    Initial thought when first seeing this was "DA F*** does he destructure 'length' for?"
    But yeah, ARRAYS ARE OBJECTS - so {length} will of course refer to the Array.prototype.length property 😅

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

      pretty neat eh

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

    Confused

  • @Thorax232
    @Thorax232 Рік тому +1

    you're out of control

  • @sandeepsharma-nf2fp
    @sandeepsharma-nf2fp Рік тому

    First view haha

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

    People, please don't do this. Do it the right, more readable way

    • @WesBos
      @WesBos  Рік тому +3

      Don’t array shame me