Home > front end >  Why aren't the Function. The prototype prototype property?
Why aren't the Function. The prototype prototype property?

Time:11-04

Prototype chain on js, have the following a definition

all function has a prototype property to the prototype object

But I used something is wrong with code validation, see



This code can demonstrate Function. The prototype (the Function prototype object) type of Function

But



Here you can see, Function. The prototype. The prototype for undefined , Function. The Function prototype without prototype property , this is why, to solve

CodePudding user response:

Function is a class object, the object has a prototype property,

Function. The prototype is a instance objects, instance objects without prototype property, have a plenty of __proto__ attribute,

CodePudding user response:

reference 1/f, the sky wave response:
Function is a class object, class object has a prototype property,

Function. The prototype is a instance objects, instance objects without prototype property, have a plenty of __proto__ attribute,


How to determine an object is instance objects or object ?
  • Related