Last active
February 28, 2021 00:09
-
-
Save osha7/c8c98c48419177c45c80d203f92a11e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stack = [] | |
// add items to the stack: | |
stack.push('Batman') | |
stack.push('Spider-Man') | |
stack.push('Wonder Woman') | |
stack.push('Black Panther') | |
stack | |
// ==> ['Batman', 'Spider-Man', 'Wonder Woman', 'Black Panther'] | |
// remove items from the stack: | |
stack.pop() | |
stack | |
// ==> ['Batman', 'Spider-Man', 'Wonder Woman'] | |
stack.pop() | |
stack | |
// ==> ['Batman', 'Spider-Man'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment