• traches@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    33
    ·
    6 hours ago

    Agreed. OP was doing well until they replaced the if statements with ‚function call || throw error’. That’s still an if statement, but obfuscated.

    • BrianTheeBiscuiteer@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      3 hours ago

      Don’t mind the || but I do agree if you’re validating an input you’d best find all issues at once instead of “first rule wins”.