Object.prototype.isPrototypeOf

Determines whether an object exists in another object’s prototype chain.

Syntax

isPrototypeOf(object)

Parameters

Return value

true if the object exists in the prototype chain of the specified object; otherwise, false.

Examples

let vehicle = {
  speed: 10,
  unit: "km/h",
}
let car = Object.create(vehicle)
vehicle.isPrototypeOf(car)
true