let shape = {
type: 10,
getTyp() {return "triangle"}
};
function Triangle(a, b, c) {
this.a = a;
this.b = b;
this.c = c;
this.getPerimeter = () => this.a + this.b + this.c;
}
Object.setPrototypeOf(Triangle, shape);
let t = new Triangle(1, 2, 3);
console.dir( t.type); //undefined я ожидаю 10
console.dir( shape.isPrototypeOf(t));//false я ожидаю true
console.dir( t.getPerimeter());//6 ok
console.dir(t.getType());//t.getType is not a function я ожидаю "triangle"
Почему не меняется prototype у Triangle?