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.
Decontextify a function by accepting this-object as the first argument.
Similar: contextify, decontextify.
function decontextify(x) // x: a function
const xasyncfn = require('extra-async-function'); function count(value) { var a = 0; for (var v of this) if (v===value) ++a; return a; } var fn = xasyncfn.decontextify(count); fn([6, 3, 4, 3], 3); // → 2 fn([6, 1, 4, 3], 3); // → 1