In object-oriented programming, we can distinguish between two types of languages. Class-based and prototype-based languages.
Class-based language...
For further actions, you may consider blocking this person and/or reporting abuse
Very useful and detailed! Thank you
I found the explanations and examples you provided to be very clear and helpful. It's great to have a better understanding of how the language works. Keep up the good work!
soooo well explained thank you
Thanks for this great explanations, for me it's more clear now.
I think it's really important to understand all these concepts, and your article helps me a lot.
Sorry if I am wrong, there is a mistake example just before section «Dimming Properties» with
toUpperCase
function.I think the explanation is wrong, JS engine don't lookup to
user
object searching fortoUpperCase
method, because before that,string primitive
was converted intoString
object ("boxing"), and on that object engine foundtoUpperCase
method.If
toUpperCase
method is created onuser
object, we can call it withuser.toUpperCase()
and not withuser.name.toUpperCase()
.Again, thanks, great explanations :)
Thanks for the clarifcation. I will relook at that section
Extremely deep post! congrats! Clicked here because I'm a nerd of class vs. prototype and I love this topic. I wrote one about the same topic (but considerably shorter 😅)
great work!
Thanks Manuel, I will take a look at yours too.
Сongratulations 🥳! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up 👍
Yaaaay, thank you all for your valuable feedbacks and reads
Your explanation was clear.
If I may summarize, there are two approaches to Object Oriented Programming(OOP) which are: 1. Classical Approach and 2. Prototype Approach.
The Prototype approach is the default standard for creating OOP in JavaScript.
The Prototype Approach has two methods to achieve OOP viz Using Object.create() method or Using constructor function method.
In all these, using classes for OOP in JavaScript is like a sweetener to writing OOp in JavaScript.
Thanks for your time and clear examples. I have bookmarked this piece and would refer techies to it. Well-done!
Thanks for your feedback. Appreciate it
Great article that will help me understand OOP in JS better.
One thing still seems strange: If I understand correctly, there are two syntactical approaches in JS that cannot be mixed, one being the proto approach of the objects and the other being the prototype property of functions.
So my objects would be either classes or functions, but I should not mix. Right?
Quite illustrative, thank you for sharing! 😄
Welcome Joel, please do share on your social handles. It might be of help to others
Thank you
This is awesome bro! Never seen JavaScript this way till reading this article. Thanks for sharing.
Neat