Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 1x 1x | /** * 用戶介面已被移除,你需要自己定義一個新的用戶介面。 * 用戶介面應該包含 firstName 和 lastName 兩個屬性,都是字串型別。 */ /** * 獲取用戶的全名 * @param user - 用戶物件,應該包含 firstName 和 lastName 兩個屬性 * * 範例: * 輸入: { firstName: 'John', lastName: 'Doe' } * 輸出: 'John Doe' */ type UserType = { firstName: string; lastName: string; } export function getFullName(user:UserType): string { // 在此實現函式 return `${user.firstName} ${user.lastName}`; } getFullName({ firstName: 'John', lastName: 'Doe' }); |