text: const { NotImplementedError } = require('../extensions/index.js');
  
  /**
   * Implement class DepthCalculator with method calculateDepth
   * that calculates deoth of nested array
   * 
   * @example
   * 
   * const depthCalc = new DepthCalculator();
   * depthCalc.calculateDepth([1, 2, 3, 4, 5]) => 1
   * depthCalc.calculateDepth([1, 2, 3, [4, 5]]) => 2
   * depthCalc.calculateDepth([[[]]]) => 3
   *
   */
   let maxDepth
  class DepthCalculator {
    calculateDepth(array, deep = 1) {
      for (let i = 0; i < array.length; i++)
  
        if (Array.isArray(array[i])) {
          maxDepth = this.calculateDepth(array[i], deep + 1)
  
  
        }
        let depth = (maxDepth > deep) ? maxDepth : deep;
      maxDepth = 0
      return depth
  
  
    }
  }
  
  module.exports = {
    DepthCalculator
  };
  