Skip to content

Instantly share code, notes, and snippets.

@jpoechill
Created June 5, 2017 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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