Difference Between instanceof and isPrototypeOf() in JavaScript Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In JavaScript, understanding object relationships and type checks is crucial for the effective programming. The Two methods that facilitate these checks are instanceof and isPrototypeOf(). While both are used to the determine the type or prototype relationships in the JavaScript they operate differently and are suited for the different scenarios.These are the following topics that we are going to discuss:Table of ContentWhat is instanceof?What is isPrototypeOf()?Difference Between instanceof and isPrototypeOf()What is instanceof?The instanceof operator in JavaScript is used to the check if an object belongs to the particular class or constructor function. It returns true if the object is an instance of the specified class or constructor otherwise false.Characteristics:Type Check: Determines if an object is an instance of the specific class or constructor.Operator: instanceofUsage: object instanceof ClassReturns: Boolean Applications:Checking object types during the runtime.Ensuring compatibility with the expected object prototypes.Example: This example shows the use of instanceof operator. JavaScript class Vehicle { } class Car extends Vehicle { } let car = new Car(); console.log(car instanceof Car); console.log(car instanceof Vehicle); console.log(car instanceof Object); Outputtrue true true What is isPrototypeOf()?The isPrototypeOf() method checks if an object exists in the another object's prototype chain. It returns true if the specified object is in the prototype chain of the object on which it is called otherwise false.CharacteristicsPrototype Chain Check: Verifies if an object is present in the another object's prototype chain.Method: isPrototypeOf()Usage: prototypeObject.isPrototypeOf(object)Returns: Boolean ApplicationsThe Verifying inheritance relationships.Checking if an object inherits properties and methods from the another object.Example: This example shows the use of isPrototypeOf() method. JavaScript function Animal() { } function Dog() { } Dog.prototype = Object.create(Animal.prototype); let dog = new Dog(); console.log(Animal.prototype.isPrototypeOf(dog)); console.log(Object.prototype.isPrototypeOf(dog)); console.log(Dog.prototype.isPrototypeOf(dog)); Outputtrue true true Difference Between instanceof and isPrototypeOf()Characteristicsinstanceof isPrototypeOf()Type Check Checks if an object is an instance of the specific class or constructor function. Checks if an object exists in theanother object's prototype chain.SyntaxThe object instanceof Class The prototypeObject.isPrototypeOf(object)ReturnsBoolean Boolean UsageUsed with the classes or constructor functions. Used with the prototype objects.ApplicationsThe Runtime type checks determining object types. Verifying the inheritance relationships checking prototype chains. Comment More infoAdvertise with us Next Article JavaScript in and instanceof operators M mguru4c05q Follow Improve Article Tags : JavaScript Web Technologies Similar Reads Difference between interfaces and classes in TypeScript In this article, we will see what is the Difference between "interface" and "Classes" in TypeScript. Interface: Interface is the virtual structure that is used for type-checking. In TypeScript we use interface keyword to create the new interface with identity. It create the structure for the same da 3 min read Difference Between valueof and keyof in TypeScript In TypeScript, valueOf() retrieves the primitive value of an object, useful for accessing inherent data types. Conversely, keyof extracts keys as a union type, crucial for type-safe property referencing and dynamic type handling in TypeScript's type system.ValueOf() methodThe valueOf() method is a b 2 min read Difference Between in and hasOwnProperty in JavaScript In JavaScript, working with the objects often involves checking for the presence of properties. The two commonly used methods for this purpose are in and hasOwnProperty. Both serve to check for the properties in objects but they have key differences in how they operate and their intended use cases.T 3 min read JavaScript in and instanceof operators JavaScript Relational Operators are used to compare their operands and determine the relationship between them. They return a Boolean value (true or false) based on the comparison result.JavaScript in OperatorThe in-operator in JavaScript checks if a specified property exists in an object or if an e 3 min read TypeScript Instanceof Operator The TypeScript instanceof operator checks if an object is an instance of a specified class or constructor function at runtime. It returns a boolean value: `true` if the object is an instance of the type, and `false` otherwise, ensuring robust type checking during execution.SyntaxobjectName instanceo 3 min read How to define instance and non-instance properties ? In this article, we will try to understand how we could define as well as create an instance and non-instanced properties in JavaScript. Before analyzing instance and non-instanced properties let us first see the following syntax of creating a class in JavaScript since both instance and non-instance 3 min read Like