'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;

@@ -69,227 +69,581 @@
 %0A * 
-@constructor Stack%0A * @summary Creates an empty array%0A */%0A%0A  constructor(stack) %7B%0A    this.stack = %5B%5D;%0A  %7D%0A%0A  push(value) %7B%0A    this.stack.push(value);%0A  %7D%0A%0A  pop() %7B%0A    this.isEmpty;%0A      return this.stack.shift;%0A  %7D
+Creates an empty array%0A * %0A * @constructor%0A * @this %7BStack%7D%0A */%0A%0A  constructor(stack) %7B%0A    this.stack = %5B%5D;%0A  %7D%0A%0A/**%0A * Adds an element to stack%0A * %0A * @function%0A * @this %7BStack%7D%0A * @example push(100500);%0A * @param value - value that you wish to put in stack%0A */%0A%0A%0A  push(value) %7B%0A    this.stack.push(value);%0A  %7D%0A%0A/**%0A * Removes an element from stack%0A * %0A * @function%0A * @this %7BStack%7D%0A * @example pop();%0A */%0A%0A  pop() %7B%0A    this.isEmpty;%0A      return this.stack.shift;%0A  %7D%0A%0A/**%0A * Returns the first element in stack%0A * %0A * @function%0A * @this %7BStack%7D%0A * @example peek();%0A */
 %0A%0A  
@@ -782,16 +782,138 @@
  %7D%0A  %7D%0A%0A
+/**%0A * Checks if stack is empty%0A * %0A * @function%0A * @this %7BStack%7D%0A * @returns true/false%0A * example stack.isEmpty();%0A */%0A%0A
   isEmpt

add jsDoc to every function