this.x = 9;
var module = {
x: 81,
getX: function() { return this.x; }
};
module.getX(); // 81
var getX = module.getX;
console.log(getX()) // 9
In the first situation i understand that x = 81, because it point to the outer scope where x = 81
, but
why getX
at the end is 9
?