text: const inspect = require('util').inspect
  
  class Node {
    constructor(val = {}) {
      this.val = val
      this.ch = []
    }
  
    addChild(val) {
      this.ch.push(new Node(val))
    }
  }
  
  const processTree = node => {
    if (!node) return undefined
    console.log(`Node val = ${node.val}`)
    if (node) for (const child of node.ch) processTree(child)
  }
  
  const tree = new Node(1)
  tree.addChild(2)
  tree.addChild(3)
  
  tree.ch[0].addChild(4)
  tree.ch[0].addChild(5)
  
  tree.ch[0].ch[0].addChild(8)
  
  tree.ch[1].addChild(6)
  tree.ch[1].addChild(7)
  
  console.log(inspect(tree, false, null, true))
  // printTree(tree);
  