Skip to content

Commit d511f07

Browse files
author
AmiyahJo
committed
fix: adjustments to this.top.val and boolean in stack.ts
1 parent d9eaced commit d511f07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lesson_12/structs_ts/src/stack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export class Stack {
2828
return null;
2929
}
3030

31-
return this.top.val;
31+
return this.top!.val;
3232
}
3333

3434
isEmpty(): boolean {
35-
return this.top === undefined;
35+
return this.top === null;
3636
}
3737
}

0 commit comments

Comments
 (0)