We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Attach prefix arguments to leftmost parameters of a function.
Alternatives: attach, attachRight. Similar: bind, attach.
function attach(x, ...prefix) // x: a function // prefix: prefix arguments
const xasyncfn = require('extra-async-function'); var fn = xasyncfn.attach(Math.min, 100); fn(180, 130); // Math.min(100, 180, 130) // → 100 var array = [1]; var fn = xasyncfn.attach((...vs) => array.push(...vs), 10, 10); fn(1, 2, 3); // array.push(10, 10, 1, 2, 3) array; // → [1, 10, 10, 1, 2, 3]