# jsfuck

> Write any JavaScript with just 6 characters: []()!+

Latest version **0.4.0** (published 2015-10-22) · 287 weekly downloads

## Install

```sh
npm install jsfuck
pnpm add jsfuck
yarn add jsfuck
bun add jsfuck
```

Provides the command `jsfuck`.

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2015-10-22 |
| First published | 2013-09-18 |
| Weekly downloads | 287 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Martin Kleppe |
| Maintainers | aemkei |
| Keywords | esoteric, obfuscation |

## Links

- npm: https://www.npmjs.com/package/jsfuck
- Repository: https://github.com/aemkei/jsfuck
- Issues: https://github.com/aemkei/jsfuck/issues
- npm.io page: https://npm.io/package/jsfuck

## Recent versions

- 0.4.0 (latest) — 2015-10-22
- 0.1.0 — 2013-09-18

## README

# JSFuck `[]()!+`

JSFuck is an esoteric and educational programming style based on the atomic parts of JavaScript. It uses only six different characters to write and execute code.

It does not depend on a browser, so you can even run it on Node.js.

Demo: [jsfuck.com](http://www.jsfuck.com)

### Example

The following source will do an `alert(1)`:

```js
[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[
!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[
+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(
![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!
![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+
[])[+[[!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+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]
]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+
[])[+[[+!+[]]]+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]])()
``` 

### Basics
              
    false       =>  ![]
    true        =>  !![]
    undefined   =>  [][[]]
    NaN         =>  +[![]]
    0           =>  +[]
    1           =>  +!+[]
    2           =>  !+[]+!+[]
    10          =>  [+!+[]]+[+[]]
    Array       =>  []
    Number      =>  +[]
    String      =>  []+[]
    Boolean     =>  ![]
    Function    =>  []["filter"]
    eval        =>  []["filter"]["constructor"]( CODE )()
    window      =>  []["filter"]["constructor"]("return this")()
    
See the full list [here](https://github.com/aemkei/jsfuck/blob/master/jsfuck.js).

### Links

* Follow [@aemkei](http://twitter.com/aemkei) (Martin Kleppe) <br>
* Original discussion at [Sla.ckers.org](http://sla.ckers.org/forum/read.php?24,32930)

---
_Source: https://npm.io/package/jsfuck · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
