Skip to content

Instantly share code, notes, and snippets.

@jpoechill
Created June 5, 2017 06:04
Show Gist options
  • Save jpoechill/60948a1836f05b67801c7edc6c37d627 to your computer and use it in GitHub Desktop.
Save jpoechill/60948a1836f05b67801c7edc6c37d627 to your computer and use it in GitHub Desktop.
Simple stacks and Queues with Javascript
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