Function.prototype.bind

Creates a bound function that has the same body as the original function.

The this object of the bound function is associated with the specified object, and has the specified initial parameters.

Syntax

bind(thisArg, ...args)

Parameters

Return value

A new bound function.

Examples

let pow = (x, e) => x ** e
let square = pow.bind(null, 2)
square(16)
65536