Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how does proto differ from constructor prototype


how does proto differ from constructor prototype  using -'javascript,prototype-programming'

function Gadget(name, color)
{
   this.name = name;
   this.color = color;
}

Gadget.prototype.rating = 3

var newtoy = new Gadget("webcam", "black")

newtoy.constructor.prototype.constructor.prototype.constructor.prototype


it will returns always the object with rating = 3

but if I do

newtoy.__proto__.__proto__.__proto__


here the chain end up with null

So why do that difference?

And in IE how can I check the null if there is not a __proto__ property?
    

asked Sep 9, 2015 by rajesh
0 votes
6 views



Related Hot Questions



Government Jobs Opening


...