3

I have a function in code which is declared like this

$get(URL, function (status, result) {}.bind(this));

What is role of bind in it ?

Ashwani Panwar
  • 3,819
  • 3
  • 46
  • 66
  • 2
    It binds the context of the callback function to `this`. Read the [`Function.prototype.bind` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). – James Allardice May 15 '15 at 12:46

0 Answers0