This is continuation of this question with more difficult case. Suppose I want to call string function with 2 parameters e.g.
console.log(
"truefalse".replace("true",1)
)
In first step I reduce characters set to jsfuck convention where we have 6 available characters: []()!+
and with a-z letters and numbers surrounded by "
chars - JS strings (which are easy to convert to those 6 chars):
console.log(
"truefalse"["replace"]("true","1")
)
The problem here was comma (forbidden character) but we can overcome this problem by use following clever technique discovered by trincot:
console.log(
["true"]["concat"]("1")["reduce"](""["replace"]["bind"]("truefalse"))
)
But the new question arise:
It is possible to call sequence of functions with 2 (or more) parameters without nesting them (which is imposed by above technique) but in "flow" way where we call next function in right side eg.: "truefalse".replace("true",1).replace("false",0)..
(without using 'eval' like solution where string is interpreted as code) ? (for function with one parameter it is possible e.g.: "truefalse"["replace"]("true")["replace"]("false")
)