Understanding .bind(this) in JavaScript OOP

.bind(this) was one of the concepts that took time before I fully understood how it worked. And the truth is many developers who started from JavaScript still struggle with the OOP paradigm. The .bind(this) helps the method it is being called on, in this case sendEmail to remember its parent class and the properties in it. Without that, calling the sendEmail() after instanciating the parent class will return undefined. #OOP #Javascript #Programming

  • text

To view or add a comment, sign in

Explore content categories