Skip to content Skip to sidebar Skip to footer

Pass Function With One Argument To Array.map Using Jsfuck

I want to convert following code (ignore console.log) to jsfuck convention where only characters []()!+ are allowed (but here for clarity also numbers and strings with a-Z and 0-9

Solution 1:

The function constructor takes more than one argument:

[]["fill"]["constructor"]('x', 'return x ** 2;')

Solution 2:

Alternative solution - it also allows to define multi-arg methods

console.log(
  [1,2,3,4,5].map( 
    []["fill"]["constructor"]('return x=>x**2')()
  )
)

Post a Comment for "Pass Function With One Argument To Array.map Using Jsfuck"