From c95d070f851a21dfbd6a249bd74b86ace1a50762 Mon Sep 17 00:00:00 2001 From: weixin_42146585 Date: Sat, 23 Dec 2023 15:40:00 +0800 Subject: [PATCH] Sat Dec 23 15:40:00 CST 2023 inscode --- index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 90d9dc2..178ccdc 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,5 @@ -let name: string = "Alice"; -let age: number = 30; +let name0: string = "Alice"; +let age: number = '28'; let isActive: boolean = true; // 函数参数和返回值的类型注释 @@ -7,6 +7,10 @@ function greet(name: string): string { return "Hello, " + name + "!"; } +const greet0 =(name: string): string=> { + return "Hello, " + name + "!"; +} + // 对象类型注释 let user: { name: string; age: number } = { name: "Bob", -- GitLab