您最多选择25个标签 标签必须以中文、字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }