面试题答案
一键面试function copyProps<T, U extends T>(target: T, source: U): T {
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key as keyof T] = source[key as keyof U];
}
}
return target;
}