News for hackers. Stuff that matters.
Re:Javascript Constructors and Prototypes by mdigi on Thursday August 01, 2013 @08:15AM (#6139711)
"In the first version, each time you create a person, a new sayHi function will be created for him, where as in the second version, only one sayHi function is ever created, and is shared amongst all persons that are created - because Person.prototype is their parent. Thus, declaring methods on the prototype is more memory efficient."
Re:Javascript Constructors and Prototypes by GeneralMayhem on Thursday August 01, 2013 @09:21AM (#6140077)
Ah, you're right, I missed that. Small amount of bile revoked.

But it should have been MUCH more strongly emphasized as the only way to do it, unless you have a very good reason, not tucked down in the bottom as "oh, if you feel like it, here's a trick to make your code a little better." Especially in a tutorial that's meant for beginners in JS.