Sharing Inherit Properties


In most programing language we read or learn about inheritance. In Inheritance method properties of parents share by child's or give to child's. So in this lesson we read about some short details of Inheritance.

Let see an example for sharing their properties.

Image
Result of this code in browser console screen
Image

In above example of sharing properties - slider 1 and slider 2 receive move direction properties by parent Slider but in both child it consume high memory for containing same properties of move direction, lets fix the move property an easy step.

Image
Result of this code in browser console screen
Image

Here both child also share the same properties but our memory save for use inherit method by this way.

For more details about prototypal inheritance please watch into next lesson where we include a breif article for this and improve our image slider code also by using inheritance method. Good bye keep learning.


Wconcert India © 2015   ·   All Rights Reserved

Free Web Hosting