jsfuck icon indicating copy to clipboard operation
jsfuck copied to clipboard

Update README.md

Open kamil-kielczewski opened this issue 4 years ago • 4 comments

More letters

kamil-kielczewski avatar Sep 08 '20 23:09 kamil-kielczewski

There are many ways to get these letters. Why this particular way?

hazzik avatar Sep 09 '20 01:09 hazzik

@hazzik This trick is non-trivial and allows to get RegExp without using any deprecated or semi-deprecated method (like escape)

Function("return"+(NaN+""["matchAll"]("")).slice(10,17))()("pattern")

after partial expansion:

[]["flat"]["constructor"]("return"+[10]["concat"](17)["reduce"](""["slice"]["bind"]((NaN+""["matchAll"]("")))))()("pattern")

but may be better place will be "Alternatives" section (?)

kamil-kielczewski avatar Sep 09 '20 09:09 kamil-kielczewski

@kamil-kielczewski use split(" "):

Function("return "+(NaN+("")["matchAll"]()).split(" ")[1])

hazzik avatar Sep 09 '20 09:09 hazzik

Yep so we have

[]["flat"]["constructor"]("return "+([]+("")["matchAll"]())["split"](" ")[1])()("pattern")

kamil-kielczewski avatar Sep 09 '20 14:09 kamil-kielczewski