Function.bind

bind

Description

Function.bind(object this, [string arg, …])

Parameters

Name Description Type Default Optional
this object No
arg, … string Yes

Examples

Example #1 – bind example
var f = function () { return this; }; var b = f.bind(location); console.log(f()); // window … console.log(b()); // location …

External references