JavaScript Object getPrototypeOf() Method Last Updated : 26 May, 2023 Suggest changes Share 1 Likes Like Report The JavaScript getPrototypeOf() is an inbuilt function in JavaScript that is used to check the prototype of an object that the user has created. Most of the time, It is used to check whether two objects have the same prototype or not. The prototype here means the internal definition of the object that is defined by the user in the JavaScript code. Syntax: Object.getPrototypeOf(created_object); Parameters: It accepts a parameter "created object" which is the object of the entity whose prototype going to be found out. Return Value: It returns the internal prototype of the object passed in the method. JavaScript examples to show the working of the getPrototypeOf() function: Example 1: This example shows the basic use of the getPrototypeOf() function in javascript. javascript // Creating a simple function function myfun() { } // creating a new object let obj = new myfun(); // getting the prototype console.log(Object.getPrototypeOf(obj)); Output: [object Object] Example 2: Another application of the getPrototypeOf() function is to check whether two objects have the same prototype or not. javascript // Creating a simple function let first_var = function myFun() { }; // Creating a object let second_var = Object.create(first_var); // Getting the output console.log(Object.getPrototypeOf (second_var === first_var)); Output: false Supported Browser : ChromeEdge FirefoxOperaSafari R RahulRanjan4 Follow 1 Article Tags : Misc JavaScript Web Technologies javascript-object JavaScript-Methods +1 More Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)9 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read My Profile ${profileImgHtml} My Profile Edit Profile My Courses Join Community Transactions Logout Like