apply, bind and call example
testing with bind, apply and call functions in js.
JavaScript
// use case of bind
var data = [{
name: 'global Aswin'
}, {
name: 'Global Devarajan'
}];
var user = {
data: [{
name: 'Aswin'
}, {
name: 'Devarajan'
}],
showUser: function(){
console.log('Printing Name: ', this.data[0].name);
}
}
user.showUser();