r/programming • • Aug 10 '12

Write any javascript code with just these characters: ()[]{}+!

http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
1.3k Upvotes

288 comments sorted by

View all comments

81

u/floridalegend Aug 10 '12

Brilliant! My head exploded when I got to the characters section.

49

u/[deleted] Aug 10 '12

And this, guys and girls, is why there is strict typing. ^ ^

36

u/TheLobotomizer Aug 10 '12

Because we can use unreadable sequences of brackets and braces to create ASCII letters?

I don't see the downside.

13

u/[deleted] Aug 10 '12

No, the lack of strict typing makes this possible.

26

u/kkeef Aug 10 '12

Exactly... He doesn't see the downside.

4

u/CSMastermind Aug 10 '12

As mentioned in the article encoding JavaScript like this can bypass security measures and web application firewalls.

11

u/[deleted] Aug 11 '12

web application firewalls

2

u/kkeef Aug 11 '12

I assumed TheLobotomizer was being facetious/funny and joined in. insert fry meme here

20

u/[deleted] Aug 10 '12

Strict typing is for... preventing XSS exploits by forcing code to contain alphanumeric characters?

7

u/Quicksilver_Johny Aug 10 '12

Yes. Or indirectly, to be able to reason about what code does (and doesn't do).

1

u/gigitrix Aug 10 '12

And not returning "Object [Object]" or whatever as a string whenever the programmer borks!

→ More replies (16)
→ More replies (1)