Example: Using .call() to pass context
JavaScript
function Bar(){
this.baz = "BAZ";
};
Bar.prototype.run = function(){
return foo.call(this);
};
var foo = function(){
return 'FOO' + this.baz;
};
var bar = new Bar();
console.log(bar.run());