old_contents: 'use strict';
  
  const assert = require('assert');
  
  class Stack {
  
  /**
   * @constructor Stack
   * @summary Creates an empty array
   */
  
    constructor(stack) {
      this.stack = [];
    }
  
    push(value) {
      this.stack.push(value);
    }
  
    pop() {
      this.isEmpty;
        return this.stack.shift;
    }
  
    peek() {
      if (!this.stack.length) {
        throw new Error('The stack is empty');
      }
      else {
        return this.stack[0];
      }
    }
  
    isEmpty() {
      assert(this.stack[0], 'The stack is empty');
    }
  
  }
  
  module.exports = Stack;
  
new_contents: 'use strict';
  
  const assert = require('assert');
  
  class Stack {
  
  /**
   * Creates an empty array
   * 
   * @constructor
   * @this {Stack}
   */
  
    constructor(stack) {
      this.stack = [];
    }
  
  /**
   * Adds an element to stack
   * 
   * @function
   * @this {Stack}
   * @example push(100500);
   * @param value - value that you wish to put in stack
   */
  
  
    push(value) {
      this.stack.push(value);
    }
  
  /**
   * Removes an element from stack
   * 
   * @function
   * @this {Stack}
   * @example pop();
   */
  
    pop() {
      this.isEmpty;
        return this.stack.shift;
    }
  
  /**
   * Returns the first element in stack
   * 
   * @function
   * @this {Stack}
   * @example peek();
   */
  
    peek() {
      if (!this.stack.length) {
        throw new Error('The stack is empty');
      }
      else {
        return this.stack[0];
      }
    }
  
  /**
   * Checks if stack is empty
   * 
   * @function
   * @this {Stack}
   * @returns true/false
   * example stack.isEmpty();
   */
  
    isEmpty() {
      assert(this.stack[0], 'The stack is empty');
    }
  
  }
  
  module.exports = Stack;
  
subject: add jsDoc to every function