fix:链表理论基础.md
typescript中,null只能赋值给any和null类型变量。这里需要采用联合类型声明。
This commit is contained in:
parent
984576943a
commit
31e340bf6c
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue