为此,添加一个?在属性名称之后: function printName(obj: { first: string; last?: string }) { // ... } // Both OK ...
確定! 回上一頁