- First, I start with implementing the class
Stackwhich is used for the stack. - In order to store the data in the stack, I am using the constructor method to create and initialize the stack. The
datavariable will hold elements to our stack. - The
pushmethod is used to add elements to our stack. - The
popmethod is used to remove the last element from our stack. - The
peekmethod is used to return the last element in the data property (our array). - The
emptymethod is used to check if there are any values in the stack.
-
Notifications
You must be signed in to change notification settings - Fork 0
alexandracaulea/stack-implementation-in-javascript
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Stack implementation in JavaScript
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published