V
Size: a a a
V
u
function test(fn) {
return function() {
const args = [].slice.call(arguments)
return new Function('fn', `fn('${ args.join("','") }')`)(fn)
}
}
var foo = test(function(data, data1){
console.log(data, data1)
})
foo('hello', 'world')u
A
const args = [].slice.call(arguments)
это типо такой легаси вариантconst args = [...arguments] ?V
u
const args = [].slice.call(arguments)
это типо такой легаси вариантconst args = [...arguments] ?A
function test(fn) {
return function() {
const args = [].slice.call(arguments)
return new Function('fn', `fn('${ args.join("','") }')`)(fn)
}
}
var foo = test(function(data, data1){
console.log(data, data1)
})
foo('hello', 'world')A
M
N
M
N
M
M
N
M
T
R
PS
UM