I am trying to implement a prototype object in this way:
var x1 = { self:false, max:true } var x2 = { self:true } x1.__proto__ = x2; console.log(x2.max);
I end up with an undefined error.
When I use this method, everything works:
var x1 = { self:false, max:true } var x2 = { self:true } x2.__proto__ = x1; console.log(x2.max);
What is the difference?