Lemmy.ca
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.ml · 3 years ago

The New Math

lemmy.ml

message-square
10
link
fedilink
46

The New Math

lemmy.ml

☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.ml · 3 years ago
message-square
10
link
fedilink
  • Ephera@lemmy.ml
    link
    fedilink
    arrow-up
    11
    ·
    3 years ago

    Oh no, it’s even documented on MDN:

    Screenshot showing code examples where all kinds of numbers are being converted to 4 or to 1.

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#using_parseint

    • enebe@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Sweet Flying Spaghetti Monster, that’s horrible. I’m guessing the reason is to keep the truth value equivalent when casting to boolean, but there has to be a more elegant way…

      • Ephera@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        Might be, but this is also a decent explanation: https://lemmy.ml/post/464637/comment/272066

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

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

  • 1.02K users / day
  • 1.47K users / week
  • 3.03K users / month
  • 9.48K users / 6 months
  • 662 local subscribers
  • 37.2K subscribers
  • 1.89K Posts
  • 38.5K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org