function ShapeA() {} const ShapeB = { a() { console.log('aaa'); } }; ShapeA.prototype.__proto__ = ShapeB; console.log(ShapeA.prototype.__proto__); // { a: [Function: a] } const shapeA = new ShapeA(); shapeA.a(); // aaa console.log(ShapeA.prototype === shapeA.__proto__); // true