" An esoteric programming style of JavaScript where code is written using a very limited set of characters: ( , ) , [ , ] , + , ! "

What the F%#* is JSF%#*?

From 6 Characters To...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

JavaScript Oddities

Let's Get Started...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

Try It Out...

How About Numbers...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

What About the 'o'?

Let's Get More...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

The Constructor

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

toString

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

0 - 9

{, }, (, ), [, ]

We can now create strings of JavaScript!  Can we execute it?

Function

And Now...

What's It Good For?

Hacking eBay

The End


![] === false
+[] === 0
[]+[] === ""


"hello"[0] === "h"


+("1" + "1") === 11

JavaScript "Basics"

We Need...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]


![]+[] // 'false'
!![]+[] // 'true'

(![]+[])[0] // 'f'

Let's Start...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]

So...


![] === false
![]+[] === "false"
+!![] === 1
------------------------
(![]+[])[+!![]] === "a"  // same as "false"[1]



[][[]] + [] === "undefined"

[][[]] + [] // "undefined"

Let's Start...

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]

More JavaScript "Basics"


[2, 1]["sort"]() /* is the same as */ [2, 1].sort()


[]["fill"]+[] === "function fill() { [native code] }"

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]

Constructor


true["constructor"] + [] === "function Boolean() { [native code] }" 
 
0["constructor"] + []    === "function Number() { [native code] }"  

""["constructor"] + []   === "function String() { [native code] }"

[]["constructor"] + []   === "function Array() { [native code] }"

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]

toString


(10)["toString"]() === "10"


(12)["toString"](10) === "12" // base 10

(12)["toString"](2) === "1100" // base 2, or binary, for 12

(12)["toString"](8) === "14" // base 8 (octonary) for 12

(12)["toString"](16) === "c" // hex for 12



(10)["toString"](36) === "a"

(35)["toString"](36) === "z"

a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

{, }, (, ), [, ]

Punctuation & Capital Letters


"test"["bold"]() === "<b>test</b>"

Functions


function Function() { [native code] }

The constructor of any function is

the actual Function object itself


[]["fill"]["constructor"] === Function

Functions


Function("alert('test')");

produces


Function anonymous() {  
    alert('test')
}

The Rest...


[]["fill"]["constructor"]("return escape('<')")()[2] === "C"

""["constructor"]["fromCharCode"](65) === "A"

""["constructor"]["fromCharCode"](46) === "."


([]['map']+[])[+((+!![]+[])+(+!![]))]+(![]+[])[(+!![])]+([]['join']+[])[(+!![]+!![]+!![]+!![]+!![]+!![]+!![])]+((![]+[+![]])+String)[+(((+!![])+(+!![]))+[]+(+![]))]+(!![]+[])[(+!![])+(+!![])+(+!![])]+(![]+[])[(+!![])]

http://jazcash.com/a-javascript-journey-with-only-six-characters/

Punctuation & Capital Letters


"test"["bold"]() === "<b>test</b>"

Copy of JSF@!*

By Eric Danowski

Copy of JSF@!*

  • 513