- Every object have prototype property
- It holds an empty Object
- you can extend this object any time.
- you can have a constructor for this object.
encapsulation is nothing but exposing or hiding your application objects / variables / components... to out side world (nothing but creating private / public methods, properties, variables, constants, lists... so on... i will explain this by relating with real world...
when we saw the car on a road what we will see first - nothing but car body, wheels, seats, lights, bumpers..... we can't see engine inner parts unless we are dismantle it. so inner parts of the car like engine, hydraulic system, gear system, break systems are not seen by the out side world (nothing but encapsulation).
inheritance is a way to reuse the code of existing class or an object.every car is manufactured based on a engineering design..(this engineering design is nothing but a template - in our terms it is a class).
we can made N number of cars with the same template. we can have same characteristics for every car made based on that template. we don't required new templates for each car. we will have one template and reuse that to produce new ones (nothing but inheritance).
polymorphism means having more than one form...to simplify this --- a car may have lights. these lights can be used for different proposes, some time they might be used for singling the other vehicles on the road. night times they might be used for to view the road. same object but we are using for different proposes.
abstraction means recognizing common features and procedures of objects...to simple understanding... relating to existing world... every vehicle have wheel count... that may be a car, truck, auto....
we can simulate all above features in JavaScript we will have a look in the next post.....