Why is the change() method not defined in the constructor? Shouldn't it be accessed through the proto link in the p.proto?
// The first change() is not defined, why?
class Person {
constructor() {
console.log(this)
console.log(this.__proto__)
// change() // Output: not defined
}
change() {
console.log(this)
}
}
var p = new Person()
Object.prototype.change = function() {
console.log('Change in prototype')
}
change() // Output: Change in prototype