r/programming • u/alcuadrado • 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
r/programming • u/alcuadrado • Aug 10 '12
3
u/mattaereal Aug 10 '12
Well, actually to get 12 you must add: "1" + "2", which is not the same as adding: 1 + 2.
First strings, then numbers, you can also add "1" + 2, and 2 will be casted to string.
To use them as a number just add a simple + in front of them.
+("1" + "2")
+("1" + 2)