DEV Community

Nur Nafish Ahmed Nobel
Nur Nafish Ahmed Nobel

Posted on

But when should I use the bind() method ?

var obj = {
x: 81,
getX: function() {
return this.x;
}
};

alert(obj.getX.bind(obj)());
alert(obj.getX.call(obj));
alert(obj.getX.apply(obj));

Top comments (0)