Derock's Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 2 months ago

Which of these javascript expressions is false?

lemmy.ml

message-square
65
fedilink
  • cross-posted to:
  • [email protected]
1

Which of these javascript expressions is false?

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 2 months ago
message-square
65
fedilink
  • cross-posted to:
  • [email protected]
  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago
    Math.min() == Infinity
    Math.max() == -Infinity
    

    Wtf is going on JS…

    edit: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min

    Its the min value of the input params, or Infinity.

    • wise_pancake@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 months ago

      Math.min.length is 2, which weakly signals that it’s designed to handle at least two parameters

      Why would they even define this value?

      Note: I’m not a js dev, do most functions have length?

      • CameronDev@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        I am also not a JS dev, we possibly aren’t brain damaged enough to understand the perfection.

        • Venator@lemmy.nz
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          Most people don’t use JS because they think it’s perfect… they use it because it’s the language that works on web browsers… or because thier coworkers made something in it… or because the library that does what they want uses it…

          • CameronDev@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            For such a terrible language, it really has staying power…

            • bss03@infosec.pub
              link
              fedilink
              English
              arrow-up
              0
              ·
              2 months ago

              JS is the machine code of the web. Fewer and fewer people might write it directly, but it will live as long as the web platform does.

              • bufalo1973@lemm.ee
                link
                fedilink
                arrow-up
                0
                ·
                2 months ago

                Until some browser can make pages with Python, maybe.

                • bss03@infosec.pub
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  2 months ago

                  Only if that browser somehow becomes overwhelmingly popular in a market segment BEFORE it gets JS support.

                  • Venator@lemmy.nz
                    link
                    fedilink
                    arrow-up
                    0
                    ·
                    2 months ago

                    Could make a transpiler for python -> js, and serve python to the browser with a fallback to js if the python isn’t supported by the browser

        • peoplebeproblems@midwest.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          I develop with JS? All I can say is I need more brain damage to understand where is out

          • sp3ctr4l@lemmy.dbzer0.com
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            Just keep developing with it, you’ll get CTE soon.

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

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.

  • 147 users / day
  • 283 users / week
  • 1.26K users / month
  • 4.15K users / 6 months
  • 0 local subscribers
  • 24.7K subscribers
  • 1.07K Posts
  • 21.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org