From 31e340bf6c953850705bf80701f7f9df5c6622d6 Mon Sep 17 00:00:00 2001 From: Jack_ZhijieFang <56966563+laerpeeK@users.noreply.github.com> Date: Fri, 5 Aug 2022 02:45:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=93=BE=E8=A1=A8=E7=90=86=E8=AE=BA?= =?UTF-8?q?=E5=9F=BA=E7=A1=80.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typescript中,null只能赋值给any和null类型变量。这里需要采用联合类型声明。 --- problems/链表理论基础.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/链表理论基础.md b/problems/链表理论基础.md index 1a29c32a..8378f7f2 100644 --- a/problems/链表理论基础.md +++ b/problems/链表理论基础.md @@ -186,7 +186,7 @@ TypeScript: ```typescript class ListNode { public val: number; - public next: ListNode = null; + public next: ListNode|null = null; constructor(value: number) { this.val = value; this.next = null;