📅  最后修改于: 2022-03-11 14:48:28.956000             🧑  作者: Mango
// the "last" property is optional and can be undefined
function printName(obj: { first: string; last?: string }) { // ...}// Both OKprintName({ first: "Bob" });printName({ first: "Alice", last: "Alisson" });Try