Why is Javascript like this?

Why is Javascript like this?

A Conspiracy Theorist Is Talking Shirt $21.68

The Kind of Tired That Sleep Won’t Fix Shirt $21.68

A Conspiracy Theorist Is Talking Shirt $21.68

  1. 1 month ago
    Anonymous

    not my problem

    • 1 month ago
      Anonymous

      ok now write a function that generates a, b, and all the constants for any arbitrary pair of ("Fizz", "Buzz") integers (k1, k2) where k1 >=1, k2 >=1

    • 1 month ago
      Anonymous

      *mogs*

      • 1 month ago
        Anonymous

        whoops forgot image

  2. 1 month ago
    Anonymous

    Humiliation ritual.

    • 1 month ago
      Anonymous

      Obj obj = new Obj();

      • 1 month ago
        Anonymous

        var obj = new Obj();
        Obj obj = new();

  3. 1 month ago
    Anonymous

    wtf...

    • 1 month ago
      Anonymous

      I don't do javascript since I'm not a zoomer webshitter monkey but this actually makes sense. look up what an identity operator is.

      • 1 month ago
        Anonymous

        identity element*

    • 1 month ago
      Anonymous

      Infinity is the identity element of the min monoid.
      -Infinity is the identity element of the max monoid.

    • 1 month ago
      Anonymous

      Math.min / Math.max are varargs functions that return the smallest / largest value passed into them.
      OP is a homosexual that knows thus but still chose to hide it.

      • 1 month ago
        Anonymous

        RTFM Black person homosexual.

        • 1 month ago
          Anonymous

          That's agreeing with what he said

      • 1 month ago
        Anonymous

        RTFM Black person homosexual.

        it makes sense for Math.min() to return "infinitely high" if no value is passed. i.e. "there is no minimum" and vice versa

        why not? why is it mental gymnastics?

        Imagine you take the min of the result of Math.min and something else; you always want it to return that something else, so Math.min has to default to infinity.

        it's exactly the same reason why an empty sum is 0 and an empty product is 1

        Why do JavaShit apologists think that if there's a method to the madness, then it isn't madness?
        Sure, obviously yes, there's a rational reason why Math.min() returns Infinity. That doesn't preclude it from being a fricking stupid reason.

        • 1 month ago
          Anonymous

          >Why do JavaShit apologists think that if there's a method to the madness, then it isn't madness?
          >Sure, obviously yes, there's a rational reason why Math.min() returns Infinity. That doesn't preclude it from being a fricking stupid reason.
          Return the minimum value between two values
          Give it one input and it does the lowest of input vs infinity
          Give it no inputs and the lowest value is infinity

          • 1 month ago
            Anonymous

            >Give it no inputs and the lowest value is infinity
            Mathematically, that is nonsense.
            Calling a min/max function with no arguments is obviously an error on the part of the programmer, and so the compiler/interpreter should throw an error when this occurs.
            And if not that, at the very least it should return something more sensible like null.

          • 1 month ago
            Anonymous

            In programming languages, function overloading exists. This is a stupid mental gymnastics.

        • 1 month ago
          Anonymous

          >Why do
          Why don't

  4. 1 month ago
    Anonymous
    • 1 month ago
      Anonymous

      If you don't understand the reason behind most of these then kys.

      • 1 month ago
        Anonymous

        The floating point oddities are the only excusable ones. Everything else is moronic.

        • 1 month ago
          Anonymous

          You simply don't understand js

          • 1 month ago
            Anonymous

            You can understand something and also conclude that it is moronic.

      • 1 month ago
        Anonymous

        Honestly this. I use to be a le heckin "NaNNaNNaNNaN Batman!" Shitter too, but most of them make sense based on how they designed the type system. It's still dumb, but it makes perfect sense.

        • 1 month ago
          Anonymous

          >I admit it's shit, but please give me validation for the fact that I wasted my life swimming through the shit and understanding how it works

      • 1 month ago
        Anonymous

        I will keep my sanity.

    • 1 month ago
      Anonymous

      lost it at
      >(!+[]+[]+![]).length
      <9

      • 1 month ago
        Anonymous

        Ever heard about toString() ?

    • 1 month ago
      Anonymous

      >~~*Eich*~~

      • 1 month ago
        Anonymous

        We call him the Eich man

    • 1 month ago
      Anonymous

      these are all compile time errors in TypeScript, not my problem

      • 1 month ago
        Anonymous

        JavaScript should have just been TypeScript from the start then.

    • 1 month ago
      Anonymous

      The person who made this picture hasn't written a single line of code in C or C++

    • 1 month ago
      Anonymous

      Honestly type coercion presented like this is managable. The horror is when you read plain js and those types of conversions happens all around.

    • 1 month ago
      Anonymous

      makes sense

      • 1 month ago
        Anonymous

        No.

        • 1 month ago
          Anonymous

          not him, it's moronic but I can understand the reasoning for most of it

          • 1 month ago
            Anonymous

            The reasoning is that Brendan Eich had to shit out a proof-of-concept web programming language in a week and no one ever bothered to clean up his mistakes.

          • 1 month ago
            Anonymous

            what should the output of Math.sum() be? What should the output of Math.all() be? What should the output of Math.product() be? Now, what should the output of Math.min() be?

          • 4 weeks ago
            Anonymous

            >what should the output of Math.sum() be?
            The "+"-wise sum of the given arguments. If no arguments are provided, an InvalidArgumentError is thrown.
            >What should the output of Math.all() be?
            Same behavior as Array.every, where the predicate is the first argument.
            >What should the output of Math.product() be?
            The "*"-wise sum of the given arguments. If no arguments are provided, an InvalidArgumentError is thrown.
            >Now, what should the output of Math.min() be?
            The "<"-wise minimum of the given arguments. If no arguments are provided, an InvalidArgumentError is thrown.

          • 4 weeks ago
            Anonymous

            >an InvalidArgumentError is thrown.
            most annoying useless shit in the world.

          • 4 weeks ago
            Anonymous

            >t. nocoder

    • 4 weeks ago
      Anonymous

      Can someone explain these to me?

  5. 1 month ago
    Anonymous
    • 1 month ago
      Anonymous

      what the frick is 1 and 0 homie print true and false like a normal dude homie

      • 1 month ago
        Anonymous

        >what the frick is 1 and 0
        You don't know what numbers are?

        • 1 month ago
          Anonymous

          Yes?

    • 1 month ago
      Anonymous

      Disgusting trashlang.
      Why does anybody even bother with the steaming pile of horseshit shitnile languages.

      • 1 month ago
        Anonymous

        Anon is being a moron on purpose. fmax and fmin in C are functions, not constants. He was thus dereferencing the function pointers.

    • 1 month ago
      Anonymous

      The troony compares functions

      Disgusting trashlang.
      Why does anybody even bother with the steaming pile of horseshit shitnile languages.

      and the other troony, from the same discord server, jumps in to advertise his goods before roping when the shift is over.

  6. 1 month ago
    Anonymous

    this isn't really exclusive to javascript.
    as a rule, if you take types and operators too seriously in programming, you're going to have a bad time.

  7. 1 month ago
    Anonymous

    it makes sense for Math.min() to return "infinitely high" if no value is passed. i.e. "there is no minimum" and vice versa

    • 1 month ago
      Anonymous

      This mental gymnastics makes no sense.

      • 1 month ago
        Anonymous

        it's exactly the same reason why an empty sum is 0 and an empty product is 1

        • 1 month ago
          Anonymous

          sum and product is not constant, minimum number is.

      • 1 month ago
        Anonymous

        why not? why is it mental gymnastics?

      • 1 month ago
        Anonymous

        Imagine you take the min of the result of Math.min and something else; you always want it to return that something else, so Math.min has to default to infinity.

    • 1 month ago
      Anonymous

      This mental gymnastics makes no sense.

      This is being implemented as follows is obvious:
      function max(...values) {
      let m = -Infinity;
      values.forEach(v => {
      if (v > m)
      m = v;
      });
      }

      But given that javascript numbers are always boxed, they could have picked null instead.

      • 1 month ago
        Anonymous

        That's clearly an incorrect implementation.

        • 1 month ago
          Anonymous

          right, forgot return m;

  8. 1 month ago
    Anonymous

    I'm a firm believer of JS being the worst mainstream programming language, but you're intentionally being a misleading homosexual, OP.

  9. 4 weeks ago
    Anonymous

    Correction: "*"-wise product.

  10. 4 weeks ago
    Anonymous

    git gud

Your email address will not be published. Required fields are marked *