var obj = {
x: 81,
getX: function() {
console.log( this.x)
}
};
var getX = obj.getX.bind(obj);//use obj as 'this';
getX();//81
var getX = function(){
obj.getX.apply(obj);
}
getX();//also 81
使用bind和call/apply看起来非常相似,我想知道它们之间有什么区别。上面的两个getX函数是相同的吗?