I need a function that has same functionality as Function.prototype.bind(). I have:
export function customBind(func, context, ...args) {
const bindArgs = [].slice.call(arguments, 2);
return function() {
const funcArgs = [].slice.call(arguments);
return func.apply(context, bindArgs.concat(funcArgs), ...args);
};
}
And error:
error Use the rest parameters instead of 'arguments' prefer-rest-params
How I can change arguments on smth else? Just tried with args but that isn't correct.