TypeScript和JavaScript复制类实例的方法(保留原型链)

const origin = new A();
const duplicate = Object.assign(Object.create(A.prototype), origin);

你可能感兴趣的:(TypeScript和JavaScript复制类实例的方法(保留原型链))