.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
Understanding .bind(this) in JavaScript OOP
More Relevant Posts
-
Day 9 of #30DaysOfJavaScript on LeetCode Today's challenge: 2703 — Return Length of Arguments Passed The task was to write a function that returns the number of arguments passed to it — a simple yet elegant problem to explore rest parameters in JavaScript. Here’s my solution 👇 var argumentsLength = function(...args) { return args.length; }; It’s a short problem but a great reminder that even small concepts like this are essential for mastering function flexibility in JavaScript! Try it out here : https://lnkd.in/g6WC5mu7 #JavaScript #LeetCode #CodingChallenge #LearningJourney #30DaysOfCode #Functions #RestParameters #Programming
To view or add a comment, sign in
-
-
Just published a beginner-friendly guide to understanding function binding in JavaScript! If you've ever wondered why `this` becomes undefined in callbacks, this article breaks it down with simple examples. Perfect for developers learning JavaScript or anyone who needs a refresher on bind() 💻 https://lnkd.in/dmAU3Rhc #JavaScript #WebDevelopment #Programming #Coding
To view or add a comment, sign in
-
If you are still struggling to understand some JavaScript trick concept of Deep and Shallow clone join me as I explore and break down how to deep and shallow clone and also how to apply them with confidence Let's discuss Deep and Shallow Clone in JavaScript jabo Landry ・ Nov 1 #webdev #javascript #programming #beginners https://lnkd.in/gYeFwW4e
To view or add a comment, sign in
-
If you are still struggling to understand some JavaScript trick concept of Deep and Shallow clone join me as I explore and break down how to deep and shallow clone and also how to apply them with confidence Let's discuss Deep and Shallow Clone in JavaScript jabo Landry ・ Nov 1 #webdev #javascript #programming #beginners https://lnkd.in/gYeFwW4e
To view or add a comment, sign in
-
⚡ Functions in JavaScript — Less Typing, More Flexing 😎 Today I finally learned functions, and wow… they make coding so much easier! Functions are basically your personal minions 🫡 You define them once — and they do the job every time you call them! Here’s what I learned 👇 🔹 Functions make your code clean and reusable 🔹 They accept parameters to work flexibly 🔹 And help you avoid writing the same logic again and again 🙌 It’s crazy how powerful something so simple can be. One function call — and boom 💥 — everything just works! Next up → Arrow functions 🏹 Let’s see how they make things even shorter and smarter. #JavaScript #WebDevelopment #Frontend #CodingJourney #Functions #LearningInPublic #DeveloperLife #Programming #CleanCode #100DaysOfCode
To view or add a comment, sign in
-
-
[Boost] Change your old methods for writing a JavaScript Code - Shorthand's for JavaScript Code Simc Dev ・ Nov 3 #javascript #webdev #programming #beginners https://lnkd.in/gAQNR_jj
To view or add a comment, sign in
-
[Boost] Change your old methods for writing a JavaScript Code - Shorthand's for JavaScript Code Simc Dev ・ Nov 3 #javascript #webdev #programming #beginners https://lnkd.in/gAQNR_jj
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development