• NichtElias@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    4 days ago

    match isn’t just equivalent to switch though, so in this case it actually makes sense to call it something different.

    • Archr@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      This is very true. Match statements are much more powerful that switch statements in any other language.

      For instance:

      • matching objects very specifically
      • if conditions within case statements
      • pulling variables from inside of the object directly.