From b562d043f38e198e7b8c77a4f0b40405f5241ff6 Mon Sep 17 00:00:00 2001 From: wangwei <153692773@qq.com> Date: Mon, 14 Nov 2022 14:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typescript文件 --- person.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 person.tsx diff --git a/person.tsx b/person.tsx new file mode 100644 index 0000000..719aaba --- /dev/null +++ b/person.tsx @@ -0,0 +1,11 @@ +interface IPerson { + name: string; + age: number; +} + +function test(opt: IPerson) { + let key: (keyof IPerson); + for (key in opt) { + console.log(opt[key]); + } +} \ No newline at end of file