mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
fix:链表理论基础.md
typescript中,null只能赋值给any和null类型变量。这里需要采用联合类型声明。
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user