var x = 9,
module = {
getX: function() {
return this.x;
},
x: 81
};
// "module.getX()" called, "module" is "this", "module.x" is returned
module.getX(); // > 81
// "getX()" called, "this" is global, "x" is returned
getX(); // > 9
// store a reference with "module" bound as "this"
var boundGetX = getX.bind(module);
// "boundGetX()" called, "module" is "this" again, "module.x" is returned
boundGetX(); // > 81 |