You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

person.tsx 180 B

1234567891011
  1. interface IPerson {
  2. name: string;
  3. age: number;
  4. }
  5. function test(opt: IPerson) {
  6. let key: (keyof IPerson);
  7. for (key in opt) {
  8. console.log(opt[key]);
  9. }
  10. }