Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. export class Frame {
  2. constructor (value) {
  3. this.value = value;
  4. this.next = null;
  5. }
  6. }
  7.  
  8.  
  9.  
  10. export class Stack {
  11. constructor() {
  12. this.root = null;
  13. }
  14.  
  15.  
  16.  
  17. push(frame) {
  18. let newFrame;
  19. let current = this.root;
  20.  
  21. if(this.root === null){
  22. this.root = newFrame;
  23. }else{
  24. newFrame.next = this.root;
  25. this.root = newFrame;
  26. }
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement