interface Person { name: string; age: number; email?: string; } function describePerson(person: Person): string { const emailPart = person.email ? `, reachable at ${person.email}` : ''; return `${person.name} is ${person.age} years old${emailPart}.`; } console.log(describePerson({ name: 'Philip', age: 35, email: 'philip@example.com' })); console.log(describePerson({ name: 'Sam', age: 28 })); /* Notes: - email being marked optional (email?: string) means an object missing it entirely (the second call) is still valid according to the Person interface — no error from the type checker. - The ternary checks person.email truthiness before building the email part of the sentence, since it might be undefined. */