Hello All , today i am going to show bind method of javascript. Please find below example where we have bind this keyword to function for return email id of the user.
If you will not use this method then it will return undefined.
let Person = { name:"test", email:"test.cloudweblabs@gmail.com", getEmail:function(){ return (function(){ return this.email;}).bind(this)(); } } let email = Person.getEmail(); console.log(email);
Hope this will help you.
Thank you