code: function getNodesByTypeHelper(childArray, type) {
    let nodes = [].concat(childArray.filter(element => element.type === type));
    let otherNodes = [];
    childArray.forEach(node => {
      if (hasChildren(node)) {
        otherNodes = otherNodes.concat(getNodesByTypeHelper(node.children, type));
      }
    });
    return nodes.concat(otherNodes);
  }
docs: /*
  Helper function for getNodesByType