When you create multiple instances of Apple, you will only have one instance of say() in memory. However, when you create multiple instances of the banana, you will create many instances of the say() function.
That's why prototypes save memory. You also avoid the cost of processing to create and assign the say() function.
In addition, if you change the properties of the parent, if the child does not replace this property, the changes will be visible from the child.
Tim Rogers May 6 '11 at 14:10 2011-05-06 14:10
source share