Yet another way to invoke functions without parentheses

(blog.ikaes.de)

47 points | by aragonite 2 days ago

7 comments

  • hans_castorp 17 minutes ago
    This reminds me of "Creators admit Unix, C hoax" (e.g. https://www.gnu.org/fun/jokes/unix-hoax.html)

    > We stopped when we got a clean compile on the following syntax:

        for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);
  • nathell 9 minutes ago
    I love this. This is a fun hack, but the article also hearkens back to pre-LLM days when people were still interested in _code_.
  • TheSilva 40 minutes ago

      Object.prototype.message='alert\x281337\x29';Array.prototype.toString=Error.prototype.toString;Error.prepareStackTrace = Function;const x = new Error;x.valueOf=x.stack;+x;
    
    Well, that's a mouthful! So many years and JavaScript still can do the most amazing, weird, awesome, scary, obscure, and sexy things in the world of coding.
  • pards 31 minutes ago
    Off topic: This website looks like a ransom note
  • semiquaver 39 minutes ago
    JavaScript is so cursed.
  • CoalitionOfPity 26 minutes ago
    GPTzero says this entire thing is AI generated for those concerned.
    • nathell 6 minutes ago
      Doesn’t feel LLM-y to me. If it is LLM-generated, the LLM must have been explicitly instructed to ignore sentence capitalization and invent a persona (‘i chose...’).
    • nmstoker 19 minutes ago
      Aha, that's a great reassurance then! ;-)
    • LatencyKills 21 minutes ago
      The irony of using AI to determine if something was written by AI.
  • aktenlage 36 minutes ago
    What's the purpose of the +x at the end?
    • undecidabot 23 minutes ago
      The unary plus implicitly converts an expression to a number, which calls `valueOf` for non-primitive values.
    • emaro 32 minutes ago
      I think to implicitly trigger the valueOf function.