code: function leaves() {
                  if (!this.children || this.children.length === 0) {
                      // this is a leaf
                      return [this];
                  }
  
                  // if not a leaf, return all children's leaves recursively
                  var leaves = [];
                  if (this.children) {
                      for (var i = 0, _length2 = this.children.length; i < _length2; i++) {
                          leaves.push.apply(leaves, this.children[i].leaves());
                      }
                  }
                  return leaves;
              }
docs: Returns an array of all leaf nodes below this one.
  @returns {Array}