Q:

Why is property unaccessible from the setter defined on prototype

I have this code:
function Test2() {
  this.data = 1;
  this.unaccesible = 7;
}

Object.defineProperty(Test2.prototype, "data", {
  get: function() {
    return this.data;
  },
  set: function(nv) {
    // here this.unaccesible is undefined - why?
    console.log(this.unaccesible);
  }
});

var o = new Test2();
o.data = 2;

Why the property is not available inside the setter?
console.log(this.unaccesible);

A:

When the instance of Test2 is created and line 2 is executed, which is  this.data = 1, this is defined and it has prototype which  has "data" property but the instance itself doesn't have "data" yet. That's why prototype's data-property setter method is called and it's happening before this.unaccesible = 7. that is why this.unaccesible is undefined at this point

