Slevin.Horse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 7 months ago

JavaScript

lemmy.ml

message-square
14
link
fedilink
2

JavaScript

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 7 months ago
message-square
14
link
fedilink
  • Avid Amoeba@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    This is too stupid so I had to check.

    Fuck me.

    • Gsus4@mander.xyz
      link
      fedilink
      arrow-up
      1
      ·
      7 months 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 🤭

    • Cid Vicious@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      I think I’m on the side of “if you do this in your code, you deserve what you get.”

    • irelephant [he/him]@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      pro tip:

      "ba" + 0/0 + "a"
      
      • 𝕨𝕒𝕤𝕒𝕓𝕚@feddit.org
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        This has got to be baNaNa

        • ChickenLadyLovesLife@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          7 months ago

          That is absolutely (n > 1) * ("ba" + 0/0 + "a")

          • Matombo@feddit.org
            link
            fedilink
            arrow-up
            1
            ·
            7 months ago

            (n > 1) * (“ba” + 0/0 + “a”)

            Uncaught ReferenceError: n is not defined

            ?

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 340 users / day
  • 3.99K users / week
  • 8.44K users / month
  • 13.6K users / 6 months
  • 1 local subscriber
  • 28.1K subscribers
  • 798 Posts
  • 11.5K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.13
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org