text: /*
  create a stack from scratch: using an array implementation
  */
  
  class Stack {
    constructor() {
      this.array = [];
    }
  
    // class Stack {
    //   constructor() {
    //     this.top = null;
    //     this.bottom = null;
    //     this.length = 0;
    //   }
    peek() {
      return this.array[this.array.length - 1];
    }
    push(value) {
      this.array.push(value);
      return this;
    }
    pop() {
      this.array.pop();
      return this;
    }
  }
  
  const myStack = new Stack();
  myStack.push("google");
  myStack.push("amazon");
  myStack.push("khan academy");
  myStack.pop();
  
  console.log(myStack);
  