# New JavaScript trick invokes arbitrary functions without parentheses

Original title: Yet another way to invoke functions without parentheses

> Hacker News story 50077225 · language: en · submitted 2026-10-13
> Web version: https://zeli.app/story/50077225
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 262 · by [aragonite](<https://news.ycombinator.com/user?id=aragonite>) · 💬 105
[original](<https://blog.ikaes.de/yet-another-way-to-invoke-functions-without-parentheses/>) · [HN discussion](<https://news.ycombinator.com/item?id=50077225>)

## Summary

A new technique exploits Error.prepareStackTrace and prototype pollution to call functions without parentheses. By overwriting prepareStackTrace, the stack trace becomes a function generated by the Function constructor. Polluting Object.prototype.message and Array.prototype.toString turns the stack array into executable code, and the valueOf trick triggers the call. The final payload fits in a few lines.

## Key quote

> i found yet another way to invoke arbitrary functions in javascript without using parentheses

## HN discussion (105 comments)

### [hans_castorp](<https://news.ycombinator.com/item?id=50116896>)

> 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](<https://news.ycombinator.com/item?id=50116963>)

> 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_.

### [amelius](<https://news.ycombinator.com/item?id=50117797>)

> I want to put the called function after the arguments:
>
> (((x)f)g)h
>
> So I can see exactly the order in which things happen, from left to right.
>
> As opposed to:
>
> f(g(h(x)))
>
> where I have to read backwards.

### [MattCruikshank](<https://news.ycombinator.com/item?id=50118596>)

> I want to write a super pedantic book showing every way I can think of to move data from here, to there.  In the same program, or between programs.
>
> Global variable.
>
> Parameter to a function.
>
> Pass a functor/lambda, get the value.
>
> Environment variable.
>
> Registry.
>
> File.
>
> Store it in a ping response.
>
> VRAM texture that you write and then read.
>
> Database.
>
> REST server.
>
> I'm pretty sure I could come up with a thousand ways.
>
> But...  why?  Why do I want to write this book?  Why has it been on my mind?

### [sharktheone](<https://news.ycombinator.com/item?id=50121945>)

> TC39 member here; There are a lot more ways in JS to call a function without parenthesis. The first thing to come to my mind is Symbol.isConcatSpreadable or Symbol.iterator which works in multiple places

### [CrendKing](<https://news.ycombinator.com/item?id=50117115>)

> Not gonna work on Firefox, since according to the doc, Error.prepareStackTrace is an optional API and only implemented by V8.

### [pards](<https://news.ycombinator.com/item?id=50116791>)

> Off topic: This website looks like a ransom note

### [TheSilva](<https://news.ycombinator.com/item?id=50116732>)

> 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.

---

## Cite

- Page: https://zeli.app/story/50077225
- Date: 2026-10-13
- Source: blog.ikaes.de (https://blog.ikaes.de/yet-another-way-to-invoke-functions-without-parentheses/)
- Hacker News: https://news.ycombinator.com/item?id=50077225

## Other languages

- zh: https://zeli.app/zh/story/50077225 · markdown: https://zeli.app/zh/story/50077225.md
- ja: https://zeli.app/ja/story/50077225 · markdown: https://zeli.app/ja/story/50077225.md
- ko: https://zeli.app/ko/story/50077225 · markdown: https://zeli.app/ko/story/50077225.md
- de: https://zeli.app/de/story/50077225 · markdown: https://zeli.app/de/story/50077225.md
- es: https://zeli.app/es/story/50077225 · markdown: https://zeli.app/es/story/50077225.md
- ru: https://zeli.app/ru/story/50077225 · markdown: https://zeli.app/ru/story/50077225.md
