We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c20140 commit 235c36fCopy full SHA for 235c36f
lesson_12/structs_ts/src/stack.ts
@@ -8,21 +8,21 @@ export class Stack {
8
this.top = undefined;
9
}
10
11
- push(value: number): void {
12
- const newNode = new ListNode(value);
+ push(val: number): void {
+ const newNode = new ListNode(val);
13
newNode.next = this.top;
14
this.top = newNode;
15
16
17
pop(): number | undefined {
18
if (this.isEmpty()) return undefined;
19
- const value = this.top!.value;
+ const val = this.top!.val;
20
this.top = this.top!.next;
21
- return value;
+ return val;
22
23
24
peek(): number | null {
25
- return this.isEmpty() ? null : this.top?.value;
+ return this.isEmpty() ? null : this.top?.val;
26
27
28
isEmpty(): boolean {
0 commit comments