Skip to content

Commit 88d0911

Browse files
committed
🥞 Stack Data Structure updated - Fixed typo
1 parent 638697a commit 88d0911

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Stack/stack.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Stack
2121

2222
pop() // Time Complexity O(1)
2323
{
24-
if(this.count == 0) return undefined;
24+
if(this.count === 0) return undefined;
2525

2626
let deleteItm = this.items[this.count - 1];
2727
console.log(`${deleteItm} removed`)
@@ -41,8 +41,8 @@ class Stack
4141

4242
isEmpty()
4343
{
44-
console.log(this.count == 0 ? 'Stack is empty' : 'Stack is NOT empty');
45-
return this.count == 0;
44+
console.log(this.count === 0 ? 'Stack is empty' : 'Stack is NOT empty');
45+
return this.count === 0;
4646
}
4747

4848
// Stacks size

0 commit comments

Comments
 (0)