Skip to content

Instantly share code, notes, and snippets.

@Froosk
Created February 14, 2018 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Froosk/908e699c634e48e19d09a8faa9cf9925 to your computer and use it in GitHub Desktop.
Save Froosk/908e699c634e48e19d09a8faa9cf9925 to your computer and use it in GitHub Desktop.
JSFuck Description Document
// JSFuck
// Gaining access to letters
// The way to gain access to a letter is to use arrays to get a letter.
"abc"[0] === "a"
// Strings
[]+[] // ""
// adding +[] to the end makes it a string.
[][[]]+[] // undefined
/* Letters gained: d,e,f,i,n,u */
++[][[]]+[] // NaN
/* Letters gained: N,a */
![]+[] // false
/* Letters gained: l,s */
!![]+[] // true
/* Letters gained: r,t */
// Numbers
+[]+[] === '0'
+![]+[] === '0'
+!![]+[] === '1'
[+!![]] === [ 1 ]
[+!![]]+[+![]] === '10'
// getting access to letters
// current letters: N,a,d,e,f,i,l,n,r,s,t,u
// Getting the letter 'N'
'NaN'[0]
(++[][[]]+[])[+[]]
// Getting the letter 'd'
'undefined'[2]
([][[]]+[])[+!![]+!![]]
'undefined'[5]
([][[]]+[])[+!![]+!![]+!![]+!![]+!![]]
// Constructing the word 'die'
([][[]]+[])[+!![]+!![]]+([][[]]+[])[+!![]+!![]+!![]+!![]+!![]]+(!![]+[])[+!![]+!![]+!![]]
// Getting more characters using Array.prototype.find
[]["find"]+[] === 'function find() { [native code] }'
/* Letters gained: c,o,v */
// current letters: N,a,c,d,e,f,i,l,n,o,r,s,t,u,v
// Getting 'Infinity'
+("1e309") // Infinity
+("1e309")+[] // "Infinity"
+((+!![])+(!![]+[])[+!![]+!![]+!![]]+([+!![]+!![]+!![]])+(+[])+(+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]))+[] // 'Infinity'
// Letters gained: I, y
// current letters: I,N,a,c,d,e,f,i,l,n,o,r,s,t,u,v,y
// More letters
0["constructor"]+[] === 'function Number() { [native code] }'
""["constructor"]+[] === 'function String() { [native code] }'
[]["constructor"]+[] === 'function Array() { [native code] }'
(![])["constructor"]+[] === 'function Boolean() { [native code] }'
[].find["constructor"] === 'function Function() { [native code] }'
// Letters gained: A,B,F,S,b,g,m
// How to find any number
(!![] << !![] << !![])+(+!![])+(+!![]) === 10
// How to find any lowercase letter
10["toString"](36) === 'a'
((!![] << !![] << !![] << !![]) + (+!![]) + (+!![]))["toString"](((+!![]+!![]) << (!![] << !![]) << (!![] << !![])) + (!![] << !![] << !![]))
// JSFucking the numbers
(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![])+!![] // 29
(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![]) // 24
"function String()" => "function String()"[9] // I'll deal with this one later
(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![])+!![] // 29
(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+(!![]<<!![])+!![] // 27
(!![]<<!![]<<!![]<<!![]<<!![])+!![]+!![] // 18
(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![])+!![]+!![]+!![] // 23
(!![]<<!![]<<!![]<<!![]<<!![]) // 16
[]+[] // ""
""["constructor"]+[] === 'function String() { [native code] }'
(([]+[])[([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+([][[]]+[])[+!![]]+(![]+[])[+!![]+!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+(!![]+[])[+![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+(!![]+[])[+!![]]]+[])[(!![]<<!![]<<!![]<<!![])+!![]] // s
(!![]<<!![]<<!![]<<!![])+!![] // 9
// toString = (!![]+[])[+![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+(([]+[])[([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+([][[]]+[])[+!![]]+(![]+[])[+!![]+!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+(!![]+[])[+![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+(!![]+[])[+!![]]]+[])[(!![]<<!![]<<!![]<<!![])+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[+!![]]+(([]+[])[([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+([][[]]+[])[+!![]]+(![]+[])[+!![]+!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+(!![]+[])[+!![]+!![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]]+(!![]+[])[+![]]+([][([][[]]+[])[!![]<<!![]<<!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]]+([][[]]+[])[(!![]<<!![]<<!![])+!![]+!![]]+([][[]]+[])[(!![]<<!![]<<!![]<<!![])]]+[])[(!![]<<!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![]<<!![])+!![]+!![]+!![]]+(!![]+[])[+!![]]]+[])[(!![]<<!![]<<!![]<<!![])+(!![]<<!![]<<!![])+!![]+!![]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment