JSFuck is an esoteric subset of JavaScript, where code is written using only six characters: [, ], (, ), !, and +
It will work with any compiler of JS, but its not recomended to use in a professional enviroment.
It works as follows: with these six characters you are able to create diferent types of values, beacause the wired conversion of types when you try to operate with diferent ones
then you are able to convert everything to string by adding +[], and then with square brackets you are able to select a character from it
at the end, you want to build your code as an string character by character and then use some type of eval() to execure everything
jsfuck.comvalues | representation |
---|---|
false | ![] |
true | !![] |
0 | +[] |
1 | +!![] |
2 | !![]+!![] |
10 | +( [+!![]] + [+![]] ) |
NaN | +{} |
undefined | [][[]] |
"NaN" | +{}+[] |
"[object Object]" | {}+[] |
"true" | !![]+[] |
"false" | ![]+[] |
"undefined" | [][[]]+[] |
"<font color="undefined"></font>" | ([]+[])["fontcolor"]() |
"function flat() { [native code] }" | []["flat"]+[] |
"[object Array Iterator]" | []["entries"]()+[] |
x.toString() | x+[] |
parseInt(x) | +(x) |
strings,numbers,booleans,arrays,objects
[]["filter"]["constructor"]( CODE )()
[][ (![]+[])[+![]] + ([][[]]+[])[!![]+!![]+![]+!![]+!![]+!![]] + (![]+[])[!![]+!![]] + (!![]+[])[+![]] + (!![]+[])[!![]+!![]+!![]] + (!![]+[])[+!![]] ][ ([][(![]+[])[+![]]+(![]+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+![]]]+[])[!![]+!![]+!![]] + ([][ (!![]+[])[ !![] + !![] + !![]]+ ([][[]]+[])[+!![]]+ (!![]+[])[+![]]+ (!![]+[])[+!![]]+ ([][[]]+[])[!![] +!![]+!![]+!![]+!![]]+ (!![]+[])[!![] +!![] +!![]]+(![]+[])[!![] +!![] +!![]]]()+[])[+!![]] + ([][[]]+[])[+!![]] + (![]+[])[!![]+!![]+!![]] + (!![]+[])[+![]] + (!![]+[])[+!![]] + ([][[]]+[])[+![]] + ([][(![]+[])[+![]]+(![]+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+![]]]+[])[!![]+!![]+!![]] + (!![]+[])[+![]] + ([][ (!![]+[])[ !![] + !![] + !![]]+ ([][[]]+[])[+!![]]+ (!![]+[])[+![]]+ (!![]+[])[+!![]]+ ([][[]]+[])[!![] +!![]+!![]+!![]+!![]]+ (!![]+[])[!![] +!![] +!![]]+(![]+[])[!![] +!![] +!![]]]()+[])[+!![]] + (!![]+[])[+!![]] ]("console.log(1)")()