Turbo-Charge Your Skills with the TJR Bootcamp Challenge 2026 – Get Ready to Rise!

Session length

1 / 20

Which approach creates an object that inherits from another?

Array.prototype.push

Math.random

Object.create(proto)

Prototypal inheritance is about linking objects so one can read properties from another through a prototype chain. Using Object.create(proto) makes a new object whose internal prototype is the object you pass in, so the new object automatically inherits properties and methods from that object without running a constructor. This is the direct way to establish inheritance between two objects in JavaScript. For example, const parent = { sayHi() { console.log('hi'); } }; const child = Object.create(parent); child.sayHi(); // inherited from parent

Other common operations don’t create such a link. Pushing onto an array just adds an element to that array. Math.random returns a primitive number, not an object with inheritance. JSON.parse turns text into a plain object or array with its default prototype, and it doesn’t establish inheritance from another object unless you manually adjust its prototype after parsing.

JSON.parse

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy