JS Built-ins
ObjectObject.getPrototypeOfintermediate

Object.getPrototypeOf() β€” function prototype

πŸ“– Usage Example
// Get the prototype of an object
const arr = []
Object.getPrototypeOf(arr) === Array.prototype   // β†’ true
Object.getPrototypeOf({}) === Object.prototype   // β†’ true

Use Object.getPrototypeOf() to retrieve the prototype of an object, allowing you to inspect its inheritance chain.

Object.getPrototypeOf() β€” functions

Functions are objects too. The prototype of a function is Function.prototype.

Challenge: Implement fnProtoIsFunctionProto() that returns whether the prototype of a function is Function.prototype.

fnProtoIsFunctionProto() // β†’ true
πŸ’‘ Hints (1)
  • β€’ Functions are objects whose `[[Prototype]]` is `Function.prototype`.