{ } qjs-modules

extendFunction

Source: lib/extendFunction.js (pure JS) — default export: extendFunction

Installs extra (non-enumerable) methods onto Function.prototype.

Exports

ExportArgsKindDescription
extendFunction(proto=Function.prototype)0–1functionDefines the extension methods. (default export)
FunctionExtensions—constThe bag of methods that get installed.
FunctionPrototype, Function—constThe prototype and its constructor.

Added Function.prototype methods

MethodDescription
then, catch, finallyPromise-style wrappers around the function's result.
indirect()Calls the function indirectly (detached this).
bindArguments(...)Binds specific argument positions.
bindArray(arr)Binds an array of arguments.
bindThis(thisArg)Binds only the receiver.