I’m converting some of my bad code (we learn a little more every day) and trying to use propper JS OOP tech. I’ve been Googling a lot and reading everything I can find on using “.prototype” to manage JS object inheritance. I believe I have pretty good understanding at this point but one thing is still puzzling me. I read somewhere (one of the fifty sites I’ve been to) that adding public methods to an object via .prototype -does not- add the method (the method code) to every instance of the object. Therefore it is much more memory efficient. Is this true? If so, how can that actually work? How would this public method reference the individual object instances? Does this make sense?
Thanks for any tips 🙂