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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;