function Base() {
this.a = 100
}
function Derived() {
Base.call(this)
this.b = 200
}
Base.prototype.info = function () {
console.log(this.a, this.b)
}
Object.setPrototypeOf(Derived.prototype, Base.prototype);
log = console.log
let b = new Base()
let d = new Derived()
log(b)
log(d)
d.info()
To embed this project on your website, copy the following code and paste it into your website's HTML: