Enable 2-char Jsfuck
Provide a shortest code that makes JavaScript able to do everything JavaScript is supposed to do, i.e. able to access(so no deleting [].sliceprototype.toString
unless you have a backup, even if you can simulate one [].prototype.toString
) and exec
anything, with only [
and ]
. You can choose your environment(FF/node/etc). Answering in 6-char JsFuck or something similar is welcomed.
E.g. If you run
Array.prototype[''] = 'a';
Array.prototype['a'] = 'b';
Array.prototype['b'] = function() { console.log(this[0]); };
then [][[]]
= []['']
= 'a'
, and [][[][[]]]
= []['a']
= 'b'
, so [[][[]]][[][[][[]]]]
= ['a']['b']
= function(){console.log('a')}
.
Of course, this is an invalid answer, because it can't do prompt
(web browser) or fs
(node) or anything similar, or even calling the console.log
.