Ben Howdle is a web developer from Droitwich, UK. He works by day at and by night and weekends as Two Step Media. An insatiable passion for the dynamic web and exciting web applications.

Twitter: Follow Ben Howdle on Twitter

Understanding JavaScript’s Function.prototype.bind

Function binding is probably your least concern when beginning with JavaScript, but when you realize that you need a solution to the problem of how to keep the context of this within another function, then you might not realize that what you actually need is Function.prototype.bind().

render: function () {

    this.getAsyncData(function () {





The first time you hit upon the problem, you might be inclined to set this to a variable that you can reference when you change context. Many people opt for self, _this or sometimes context as a variable name. They’re all usable and nothing is wrong with doing that, but there is a better, dedicated way.


↑ Back to top