aemkei / jsfuck

Write any JavaScript with 6 Characters: []()!+
jsfuck.com
Do What The F*ck You Want To Public License
8.07k stars 671 forks source link

Alternative representation of numbers #101

Open kamil-kielczewski opened 3 years ago

kamil-kielczewski commented 3 years ago

Hi I found following alternative representation for number 1 based on true => !![](and I construct other numbers using it)

0 => +[] 1 =>+!![] 2 => !![]+!![] 3 => !![]+!![]+!![] 4 => !![]+!![]+!![]+!![]

and so on. Construct new numbers looks trivial (and when you see repesentation of eg. number 4 it is easy to count pattern). In new way, the plus + "means" only adding numbers (cast is implicite - exept 0 and 1 where we use it to cast directly). Also edit number by hand (increasing or decreasing) is easy.

In my opinion this way of write numbers is more easy and redable than old way (which is based on true => !+[])

0 => +[] 1 =>+!+[] 2 => !+[]+!+[] 3 => !+[]+!+[]+!+[] 4 => !+[]+!+[]+!+[]+!+[]

for person who see old representation first time, it is not trivial task to construct number 3,4,... - also when you look on number 4 it is hard to count pattern and recognize it. Here + character has "not easy" meaning. Edit that number by hand (increasing/decreasing) is no easy