Assume code like. I want to access i and j in some function somefunc. How will this be achieved?
var myObj = function(){
Object.defineProperty(this, 'j'){
get: function() { return 1;}
};
}
myObj.prototype = Object.create(null);
myObj.prototype={
constructor : myObj,
i : 1,
somefunc : function(){
console.log(i + j);
}
}
this.iandthis.j? Ifsomefunc()doesn't get called in a different context (withcall()or so) it should be the object itself.