I saw a lot of replies talking about Brainfuck which is an esoteric programming language ( used for fun ) and not a web developing language so for me the most difficult language for developing a website is JSFuck.
Let’s to write the
can be written as
Now each character of the string
alert("Hello, world!") can be written using only the 6 characters
+!() in a tricky way. For a start, let’s just look at the letter “a”, how it’s written in JSFuck:
- “a”: is the second character of the string false (index 1 counting from 0)…
- “false” : “false” can be made from false+, i.e. the boolean constant false plus an empty array…
- (false+): we write false as ! (negation applied to an empty array)…
- (!+): 1 is a number, we can write it as +true…
- (!+)[+true]: since false is !, true is !!…
(!+)[+!!] «< that’s it!
In a few steps, the letter “a” has been converted into pure JSFuck code. Other characters can be much harder to produce, but over the years, tricky ways have been found to write any character using only the characters allowed in JSFuck. Anyway, those can be quite long strings for each character, and that’s why a simple “Hello, world!” program in JSFuck takes up more that 10000 characters!
But let’s come back to our example: after all JSFucked characters are joined back together like
"a"+"l"+"e"+"r"+"t"+..., there’s still the
Function(...)() part to convert.
["filter"]["constructor"], i.e., the “constructor” property of the “filter” property of an empty array. The strings “filter” and “constructor” are just sequences of characters, and we already know that there’s always a tricky way to write each character.
Now I think you know how to write letters in JSFuck but what if we need to write some numbers.
0 => + 1 => +!+ 2 => !++!+ 10 => +[[+!+]+[+]]
To summarize this is the sheet Cheat of JSFuck basics :
false => ! true => !! undefined => [] NaN => +[!] 0 => + 1 => +!+ 2 => !++!+ 10 => +[[+!+]+[+]] Array =>  Number => + String => + Boolean => ! Function => ["filter"] run => ["filter"]["constructor"]( CODE )() eval => ["filter"]["constructor"]("return eval")()( CODE ) window => ["filter"]["constructor"]("return this")()