当我分配给Employee Details对象时,如何从雇员中删除一个多余的字段。
class EmployeeDetails{
public empNo:number;
public firstName:string;
public lastName:string;
}
var employee = {
empNo:5,
firstName:'xyz',
lastName:'abc',
department:'development'
}
var emp = new EmployeeDetails();
emp=employee;
console.log(emp);
输出应为::
{
"empNo":5,
"firstName":"xyz",
"lastName":"abc"
}