Advertisement
728x90
You can use the Object.getPrototypeOf(obj) method to return the prototype of the specified object. i.e. The value of the internal prototype property. If there are no inherited properties then null value is returned.
javascript
1const newPrototype = {};
2
3const newObject = Object.create(newPrototype);
4
5console.log(Object.getPrototypeOf(newObject) === newPrototype); // trueAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 2
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
259of476