Comments (3)
@kamil-kielczewski this is because "eval source" wraps code into function() { ... CODE }
:
function anonymous() {
[1,2][1]
}
So, to get the 2
you need to encode return [1,2][1]
. The code you're getting is long but correct.
Also, jsfuck.com is outdated and if you clone source and play with index.html there, it will generate 1786 characters long code for you as opposite to 20405 on jsfuck.com.
from jsfuck.
I also want to ADD that in jsfuck it is possible to write [1,2][1]
as follows (I use concat to put elements to array):
[]['concat'](1)['concat'](2)[1]
and after change each nontrivial character we get it in full (expected) form (details here)
[][([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[+!+[]+!+[]+!+[]]+([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[+!+[]+!+[]+!+[]]+([]+[]+![])[+!+[]]+([]+[]+!![])[+[]]](+!+[])[([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[+!+[]+!+[]+!+[]]+([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([][([]+[]+![])[+[]]+([]+[][[]])[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+[][[]])[+!+[]]+([]+[][[]])[!+[]+!+[]]]+[])[+!+[]+!+[]+!+[]]+([]+[]+![])[+!+[]]+([]+[]+!![])[+[]]](!+[]+!+[])[+!+[]]
which works as expected in chrome console
from jsfuck.
@hazzik Thank you for your answer :) - may be it is good idea to publish this site using github pages it is very easy to do - here I fork this repo to my github account and publish master branch using 2 clicks (i go to menu>settings>Github pages and choose master branch): https://kamil-kielczewski.github.io/jsfuck/index.html
It is also possible to redirect /jon domain http://www.jsfuck.com/ to such github page in easy way
from jsfuck.
Related Issues (20)
- Alternative representation of numbers
- It is possible to call function with 2 arguments? HOT 4
- You can actually get the upper case version of the letters, since String.prototype.toUpperCase() exists, and we have capital U and capital C HOT 2
- Troubles to execute the current code HOT 2
- Why `escapeSequence()` treat characters whose charCodes is under 256 as ascii, not utf-16? HOT 4
- Note: Array.prototype.at() is available now HOT 3
- Documentation out of date
- JSFuck variant using "([+<])". Has anybody tried this before? HOT 13
- ([]["isPrototypeOf"] + "")[11] HOT 4
- Use array 'at' method instead of array 'filter' method HOT 3
- A better way of getting `A` HOT 2
- Faster way to get Capital A HOT 3
- easier alternative way of getting infinity through whatever buggy js exists in this world HOT 1
- JSF code does not work if CSP forbids `eval`/`new Function`
- NodeJS Support HOT 1
- Working self-hosting JSFuck compilers? HOT 4
- undefined compiles in to nothing HOT 2
- Is decode not possible using node.js? HOT 1
- Simply crack JSFuck, is there a better encryption? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsfuck.