How many times have we heard "JavaScript is not an Object-Oriented language, it's Prototype-oriented"? It turns out it's not accurate.
Here there ...
For further actions, you may consider blocking this person and/or reporting abuse
For poeple that are wondering what's the difference,
prototype
is the object that is used to build__proto__
when you create an object with new.Great article! I love the new horchata spell!
I have a question that maybe its not very related the article but I think so. Some people thinks despite javascript has this inheritance through proptotype chain is better use composition with a factory function. What do you think about that? I use to have discussions gorila-banana problem vs better performance. What would be in your opinion a better approach?
Thanks!
I'm more keen to use composition over inheritance unless I really need a different type (and in this case, I try not to have a chain, but just a single subtype), but I'm afraid prototypes have nothing to do with this. Composition vs Inheritance is a debate that extends to every Object-Oriented language, independently if they have prototypes or not.
I'm studying js and I love it, it makes such more sense now.