TypeScript和JavaScript复制类实例的方法(保留
2020-08-11 本文已影响0人
Collie
const origin = new A();
const duplicate = Object.assign(Object.create(A.prototype), origin);
const origin = new A();
const duplicate = Object.assign(Object.create(A.prototype), origin);