> function MyObject(){} > Array.prototype={};
You cannot assign a value to Array.prototype.
> MyObject.prototype={}; > var a=new Array(); > var b=new MyObject(); > alert(a.constructor==Array);
Array.prototype has a constructor property that references the Array function. Since a is an instance of Array, it inherits the property of the Array.prototype constructor.
> alert(b.constructor==MyObject);//false
You assigned an empty object MyObject.prototype, it does not have a prototype property and does not b.
MyObject.prototype.constructor = MyObject; alert(b.constructor==MyObject); // true
source share