function bindFunction(fn, ...array) {
let args = Array.from(arguments);
function F() {
return args;
}
return F.bind(bindFunction);
}
nested function, which outer function takes as a first parameter, must to bind other parameters to nested function and return them
I think this is what you are looking for.
function bindFunction(fn, ...array) {
return fn.bind(null, ...array);
}