• marcos@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 days ago

      It’s not even the coercion that is the problem here. The types are already bad by themselves.

    • dejected_warp_core@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      10 days ago

      I take this as less of a “I can’t use this intuitive feature reliably” thing and more of a “the truth table will bite you in the ass when you least expect it and/or make a mistake” thing.

      • flying_sheep@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        10 days ago

        Just use a formatter. It’ll show you that the second one is two statements:

        1. {} (the empty block)
        2. +[] coerce an empty array to a number: new Number(new Array())