Prototypal inheritance should save memory, right?
- by Techpriester
Hi Folks,
I've been wondering:
Using prototypes in JavaScript should be more memory efficient than attaching every member of an object directly to it for the following reasons:
The prototype is just one single object.
The instances hold only references to their prototype.
Versus:
Every instance holds a copy of all the members and methods…