|
@@ -364,6 +364,24 @@ New characters:
|
|
|
|
|
|
`j`, `<`, `>`, `=`, `"`, `/`
|
|
|
|
|
|
+### Calling method with more than one argument
|
|
|
+---
|
|
|
+
|
|
|
+Calling method with more than one argument is non trivial - to do it you can use following [technique](https://stackoverflow.com/q/63601330/860099) (discovered by trincot) - for example example: `"truefalse".replace("true","1")` can be written as follows:
|
|
|
+
|
|
|
+```js
|
|
|
+["true"]["concat"]("1")["reduce"](""["replace"]["bind"]("truefalse"))
|
|
|
+```
|
|
|
+### Calling method with more than one argument in "flow way"
|
|
|
+
|
|
|
+To be able to call mehod (with multiple arguments) in right side on results of previous method you can use this [technique](https://stackoverflow.com/q/63604058/860099) (discovered by trincot) - for example: `"truefalse".replace("true","1").replace("false","0")` can be written as follows:
|
|
|
+
|
|
|
+```js
|
|
|
+"truefalse"
|
|
|
+ ["split"]()["concat"]([["true"]["concat"]("1")])["reduce"](""["replace"]["apply"]["bind"](""["replace"]))
|
|
|
+ ["split"]()["concat"]([["false"]["concat"]("0")])["reduce"](""["replace"]["apply"]["bind"](""["replace"]))
|
|
|
+
|
|
|
+```
|
|
|
|
|
|
### `number.toString(x)` – Getting any lowercase letter
|
|
|
|
|
@@ -391,8 +409,13 @@ When evaluating `function anonymous() { return this }`, we get the invocation co
|
|
|
|
|
|
Getting a reference to `window` is another huge step forward for JSFuck. With the brackets characters, we could only dig in the available objects: numbers, arrays, some functions... With a reference to the global scope, we now have access to any global variable and the inner properties of these globals.
|
|
|
|
|
|
----
|
|
|
+### Create regular expression object
|
|
|
|
|
|
+You can create regular expression e.g. `/pattern/g` as follows
|
|
|
+
|
|
|
+```js
|
|
|
+[]["fill"]["constructor"]("return RegExp")()("pattern","g")
|
|
|
+```
|
|
|
|
|
|
# Alternatives
|
|
|
|