monyet.cc
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@cm0002@lemmy.world to Programmer Humor@programming.dev • 22 days ago

Which of these javascript expressions is false?

lemmy.ml

message-square
83
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
501

Which of these javascript expressions is false?

lemmy.ml

@cm0002@lemmy.world to Programmer Humor@programming.dev • 22 days ago
message-square
83
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
  • @jenesaisquoi@feddit.org
    link
    fedilink
    English
    72•22 days ago

    It’s C

    • @JCpac@lemmy.today
      link
      fedilink
      English
      115•22 days ago

      No, it’s Javascript, keep up

      • @FanBlade@lemmynsfw.com
        link
        fedilink
        English
        53•22 days ago

      • @ChickenLadyLovesLife@lemmy.world
        link
        fedilink
        English
        9•22 days ago

        Javascript is basically just C with some syntactical sugar, right? RIGHT?!?

        • @kryptonianCodeMonkey@lemmy.world
          link
          fedilink
          7•
          edit-2
          21 days ago

          Say when…

        • @mcv@lemm.ee
          link
          fedilink
          English
          3•21 days ago

          To the contrary, it’s Lisp with a lot of syntactic sugar to make it look more like C, but underneath it’s nothing like C. It’s a weird hybrid.

        • @AngryCommieKender@lemmy.world
          link
          fedilink
          1•21 days ago

          I would say that your username doesn’t check out, but being honest we’re all coders, or at least script kiddie pirates, around here.

          • @ChickenLadyLovesLife@lemmy.world
            link
            fedilink
            English
            3•21 days ago

            For reference.

    • @MajesticElevator@lemmy.zip
      link
      fedilink
      11•21 days ago

      Wtf? Min > Max???

      • Pup Biru
        link
        fedilink
        English
        19•
        edit-2
        21 days ago

        Math.min isn’t the minimum integer; it’s the minimum of a list (and max visa versa)… the min/max of an undefined list is the same… IDK what it is, but this probably the most reasonable of the “WTFs” they could have put there i think… other languages would throw an exception or not compile (which JS definitely SHOULD do instead of this, buuuuut lots of JS has aversions to errors)

        *edit: okay the curiosity was killing me: Math.min() is Infinity and Math.max() is -Infinity

        • @MajesticElevator@lemmy.zip
          link
          fedilink
          4•21 days ago

          That explains it then. It could be mislead for -inf and +inf

    • @PrettyFlyForAFatGuy@feddit.uk
      link
      fedilink
      1•22 days ago

      deleted by creator

      • Log in | Sign up
        link
        fedilink
        8•21 days ago

        I always thought that NaN is required by IEEE rules to never equal any other number, including itself, because you can make NaN in different ways and this shouldn’t result in equality or something, so C is wild but not javascript’s fault.

        The other three being true is definitely javascript’s insane fault, though.

      • @timhh@programming.dev
        link
        fedilink
        2•21 days ago

        Completely wrong. I’m hoping this was a joke… :-D

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
  • 1.86K users / day
  • 5.86K users / week
  • 9.97K users / month
  • 19K users / 6 months
  • 23.9K subscribers
  • 1.48K Posts
  • 55.4K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org