bind(), call(), and apply()
What higher-order function pattern is shown here?
function partial(fn, ...args) {
return fn.bind(null, ...args);
}
const add = (a, b) => a + b;
const addFive = partial(add, 5);
console.log(addFive(3));
function partial(fn, ...args) {
return fn.bind(null, ...args);
}
const add = (a, b) => a + b;
const addFive = partial(add, 5);
console.log(addFive(3));