• 2 Posts
  • 10 Comments
Joined 2 years ago
cake
Cake day: August 25th, 2023

help-circle



  • Gsus4@mander.xyztoProgrammer Humor@programming.devJavaScript
    link
    fedilink
    arrow-up
    115
    ·
    edit-2
    23 days ago

    Hm, playing devil’s advocate, I think it is because the minus has not been defined as a string operation (e.g. it could pop the last char), so it defaults to the mathematical operation and converts both inputs into ints.

    The first is assumed to be a concat because one of the parcels is a string…

    It’s just doing a lot of stuff for you that it shouldn’t be in first place 🤭