r/javascript • • Oct 27 '26

I've proven that you don't need quotes or parentheses in JavaScript

https://blog.ikaes.de/generating-strings-without-parentheses-in-javascript/

You can overwrite the prepareStackTrace property of the Error object by String prototype's functions and invoke them without parentheses. Then by overwriting the Error and Array prototype it is possible to control the arguments. Combining this behavior, together with some JSFuck-inspired tricks, it is possible to generate arbitrary JavaScript strings and run arbitrary JavaScript with only letters + - = and ,

98 Upvotes

20 comments sorted by

61

u/Elkemper Oct 27 '26

That is an extraordinary way to use free will!

12

u/DrAdalbbert Oct 27 '26

it took me way longer to discover this than id like to admit

17

u/Designer_Mountain_84 Oct 27 '26

But… why?

27

u/DrAdalbbert Oct 27 '26

Why not :D

It has literally 0 practical applications, besides maybe as a WAF bypass. But I think it's fun

3

u/Spleeeee Oct 27 '26

It’s primary use case is whimsy

2

u/sexytokeburgerz Oct 27 '26

Cybersec, i would imagine.

0

u/Valkertok Oct 28 '26

With AI that can efficiently reverse engineer compiled code using this as Cybersec tool is completely useless.

1

u/mallcopsarebastards 22d ago

yeesh. why do people make confident claims about things they don't understand. You realize yoiu're posting on a public forum, right? Like, where actual SMEs will read it?

1

u/leeharrison1984 Oct 27 '26

All the best ideas have been done, welcome to the end of history

2

u/jippen Oct 27 '26

Have you seen the chaos of the jsfuck transpiler? I think you would get a kick out of it as well.

11

u/DrAdalbbert Oct 27 '26

Yess! I like to think that my method is the literal opposite of jsfuck. jsCelibate :D?

i actually borrowed some methods from them to get some characters . applied without parentheses ofc

8

u/tubbo Oct 27 '26

isn't this basically coffeescript?

1

u/wendy-4535 7d ago

CoffeeScript compiles another syntax to JavaScript; this is JavaScript itself, using a restricted character set.