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.
Loading...
Related Quiz
- How does JavaScript’s class syntax relate to prototypal inheritance?
- How can you handle error responses in Express for cleaner error reporting?
- When securing a web application using JWT, implementing ________ helps in mitigating the risk of token interception.
- What is the proper way to handle errors in EJS views?
- You are tasked with developing a file upload module in Node.js. The files uploaded by users are binary data. How would you handle the incoming binary data to ensure data integrity and optimal resource utilization?