i am learning about mongoose from the book mastering mongoose by valeri karpov. he states the following.
// Calling `conn.model()` creates a new model. In this book
// a "model" is a class that extends from `mongoose.Model`
const MyModel = conn.model('ModelName', schema);
Object.getPrototypeOf(MyModel) === mongoose.Model; // true
i dont understand how a class which is as i understand it is a constructor function can have a prototype other than: "Function.prototype". (i am talking about the actual prototype and not the prototype property)
just to make it explicit that MyModel is a class/constructor he goes on to use it like so:
const document = new MyModel();
i have reviewed my understanding of protoypal inheritance in javascript and nothing has came to light that explains this.
can anyone explain what is going on here.