# bind
this.x = 9;
var module = {
x: 81,
getX: function() { return this.x; }
};
var retrieveX = module.getX;
retrieveX();
var boundGetX = retrieveX.bind(module);
boundGetX();
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
this.x = 9;
var module = {
x: 81,
getX: function() { return this.x; }
};
var retrieveX = module.getX;
retrieveX();
var boundGetX = retrieveX.bind(module);
boundGetX();