class Student {
constructor(name) {
this.name = name;
}
greet() {
console.log(`Hi, My name is ${this.name}`);
}
}
const obj = {
name: 'Dan',
age: 23
};
class ProtoStudent {
university = 'Oxford';
}
const student = Reflect.construct(Student, ['Igor'], ProtoStudent);
Reflect.apply(student.greet, obj, []);