Skip to content

Instantly share code, notes, and snippets.

@Nathan-Nesbitt
Created May 10, 2020 21:09
Show Gist options
  • Save Nathan-Nesbitt/3dea0b392b23a00921b64cd6a8a48694 to your computer and use it in GitHub Desktop.
Save Nathan-Nesbitt/3dea0b392b23a00921b64cd6a8a48694 to your computer and use it in GitHub Desktop.
Stack Example JavaScript
// Create a "stack" //
var stack = [];
// Push values onto the stack //
stack.push(3);
stack.push(2);
stack.push(1);
// Print off the order that the values are in //
console.log(stack.pop());
console.log(stack.pop());
console.log(stack.pop());
@Nathan-Nesbitt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment