relopwap.blogg.se

What is js prototype
What is js prototype











Only objects are available for making prototype relations.

what is js prototype

If we want to inherit a second class we need to use the _proto_._proto_ property which makes the hierarchy complex and difficult to keep track of.

  • Multiple inheritances can only be achieved at a different level.
  • It reduces flexibility as a single _proto_ property can inherit only one class.
  • We will revisit how the properties and methods of a object are being inherited in the later part of the article. Now we can use any method and properties from the company object using the worker object.

    what is js prototype

    The first ] : Object you see is the prototype of the company object and the second one is the javascript's default Object prototype which is present in any object instance.













    What is js prototype