hello.ts 224 B

1234567891011121314151617
  1. type User = {
  2. name: string;
  3. age: number;
  4. };
  5. function isAdult(user: User): boolean {
  6. return user.age <= 18;
  7. }
  8. const justine: User = {
  9. name: 'Justine',
  10. age: 23,
  11. };
  12. const isJustineAnAdult: boolean = isAdult(justine);