Confused about Douglas Crockford's object function
问题 I know Crockford has a famous object function for inheritance in JavaScript: function object(o) { function F() {} F.prototype = o; return new F(); } But I am confused, after the line F.prototype = o , why he doesn't he reset the F.prototype 's constructor, like this: F.prototype.constructor = F Isn't that common practice? 回答1: Isn't that common practice? Only when your're creating subclasses (constructor functions with prototypes inheriting from other prototypes). But that's not the purpose