Created
June 5, 2017 06:04
-
-
Save jpoechill/60948a1836f05b67801c7edc6c37d627 to your computer and use it in GitHub Desktop.
Simple stacks and Queues with Javascript
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
var stack = [] | |
stack.push(1) | |
console.log(stack) | |
stack.pop() | |
console.log(stack) | |
var queue = [] | |
queue.push(1) | |
queue.push(2) | |
console.log(queue) | |
queue.shift(); | |
console.log(queue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment