Which of the following JavaScript properties allows an object to inherit properties from another object?

  • inherit
  • copy
  • prototype
  • extend
In JavaScript, the prototype property is used to allow an object to inherit properties from another object. When an object is created, it inherits properties and methods from its prototype, which can be another object. This forms the basis of prototype-based inheritance in JavaScript. The other options are not standard properties used for inheritance.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *