JS is wild

JS is wild

Mike Stoklasa's Worst Fan Shirt $21.68

Ape Out Shirt $21.68

Mike Stoklasa's Worst Fan Shirt $21.68

  1. 2 months ago
    Anonymous

    imagine the obfuscation you can do with this

    • 2 months ago
      Anonymous

      thats why malware still exists. you dont get an infected .exe nowadays, you get a legit node instance on your machine (so its not suspicious to scanners) that receives obfuscated js payloads

  2. 2 months ago
    Anonymous

    innit

    • 2 months ago
      Anonymous

      2 + string 2 = 22 and as you can't subtract from a string it gets coerced to a number so 22-2 = 20

      Type coercion is easy, I don't know why all the hate, and for op there's a NaN, toLowerCase make it less apparent.

      typeof(NaN) is number btw.

      • 2 months ago
        Anonymous

        No way tha- WHAT THE FRICK

      • 2 months ago
        Anonymous

        >typeof(NaN) is number btw.

        No way tha- WHAT THE FRICK

        Of course it is, this is only surprising in languages like JavaScript because they frick up types elsewhere.

        • 2 months ago
          Anonymous

          But I've always found funny that Not a Number is a number.

  3. 2 months ago
    Anonymous

    >+(+"a") = NaN
    What confuses you, Rakeesh?

    • 2 months ago
      Anonymous

      not OP but I thought it reads
      'ba' + SomeEmptinessType + 'a'
      dunno much about js though

      • 2 months ago
        Anonymous

        That would make it so it ends with double a

        • 2 months ago
          Anonymous

          yes, that's why I thought what's the last 'a' doing there

    • 2 months ago
      Anonymous

      In Python this is just
      TypeError: bad operand type for unary +: 'str'
      And in Rust it's just
      error: expected expression, found `+`

      >TypeScript runtime
      That's a nonsensical statement, TypeScript isn't actually a programming language. It sounds like you're asking for runtime type checking for JavaScript, which is a bad idea.

      [...]
      Deno and Bun transpile the code (ie, discards everything except enums and namespaces).

      >It sounds like you're asking for runtime type checking for JavaScript, which is a bad idea.
      You can't and shouldn't check everything, but there are a lot of cases where JavaScript sees that what's happening doesn't make sense and just sort of sweeps it under the rug instead of raising an exception. use strict was a good addition, right?

  4. 2 months ago
    Anonymous

    javascribd :-Dd

  5. 2 months ago
    Anonymous

    TypeScript doesn't have this problem.
    It would be great if we can have a native TS runtime that doesn't need to transpile the code to JS.

    • 2 months ago
      Anonymous

      It's not a problem when you intentionally a create it.

    • 2 months ago
      Anonymous

      >It would be great if we can have a native TS runtime
      deno and bum already do that

      • 2 months ago
        Anonymous

        They transpile internally.

    • 2 months ago
      Anonymous

      >It would be great if we can have a native TS runtime that doesn't need to transpile the code to JS.
      https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
      Make sure to use strict to not think about the funny business from here
      https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html
      Try it. I personally cannot go back to TS. And they keep developing it further.

      Or maybe stop using JS outside the browser like a fricking Black person.

      • 2 months ago
        Anonymous

        >Or maybe stop using JS outside the browser like a fricking Black person
        You can't tell me what to do.

    • 2 months ago
      Anonymous

      >TypeScript runtime
      That's a nonsensical statement, TypeScript isn't actually a programming language. It sounds like you're asking for runtime type checking for JavaScript, which is a bad idea.

      >It would be great if we can have a native TS runtime
      deno and bum already do that

      Deno and Bun transpile the code (ie, discards everything except enums and namespaces).

  6. 2 months ago
    Anonymous

    Where does the n come from?
    a + a = n?
    I don't get it

    • 2 months ago
      Anonymous

      NaN (Not a Number)

      • 2 months ago
        Anonymous

        I'm stupid, thanks

  7. 2 months ago
    Anonymous

    now why didn't typescript take off?

  8. 2 months ago
    Anonymous

    https://jsisweird.com/

  9. 2 months ago
    Anonymous

    ("b" + "a" + + "kek" + "a").toLowerCase()
    a kek may help you understand better

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