News for hackers. Stuff that matters.
Re:How JavaScript Works: deep dive into call, apply, and bind by wruza on Friday July 09, 2021 @08:15PM (#27789893)
Prototypes have become much more of an implementation detail in recent years.

First of all, it’s just a single-handed point of view. I’m using them from time to time, because js doesn’t end with reactjs hooks or frontend, and even frontend doesn’t end with just writing “frontend glueware”.

But even if it did, what exact mechanism do you propose to bind methods to instances? Automagic? It’s not just an “implementation detail”, it is a way of doing OOP in dynamic languages. Do you want all your objects to contain references to bound copies of all of the inherited methods? The way it is is for a reason, and the reason is, it doesn’t come for free.

There are no comments on this comment yet.