Duyên Kim

42 bundles
1 filea month ago
1

Interface

entry.ts

1234567891011121314
interface IProps { id: number; name?: string; } function Display(args: IProps): string { if (args.name) { return `Hello ${args.name}` } return "Hello Word" } console.log(Display({ id: 1 })); console.log(Display({ id: 1, name: "Duyen" }));