• bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 months ago

    The libraries underneath will still allow nonsense at runtime

    Only if you use a badly written library. Most libraries have types provided by DefinitelyTyped. Those who don’t are (in my experience) so tiny that you probably aren’t using them; or, if you really wanted, can check yourself.

    In the end, if you encounter a bug, it’ still 99% of the time not a library’s fault, even if it’s written in plain JS.

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      4 months ago

      Like I said to the other person, those are just types over top of JavaScript that can still fail if/when coercion happens under the hood.

      I don’t even know how to search it now, but a specific example came up on here of a time when JavaScript libraries will cause problems, and problems you can’t even see very well if you’re expecting it to act strictly-typed.