fix:链表理论基础.md

typescript中,null只能赋值给any和null类型变量。这里需要采用联合类型声明。
This commit is contained in:
Jack_ZhijieFang
2022-08-05 02:45:36 +08:00
committed by GitHub
parent 984576943a
commit 31e340bf6c

View File

@ -186,7 +186,7 @@ TypeScript:
```typescript ```typescript
class ListNode { class ListNode {
public val: number; public val: number;
public next: ListNode = null; public next: ListNode|null = null;
constructor(value: number) { constructor(value: number) {
this.val = value; this.val = value;
this.next = null; this.next = null;