code: function nestHeadingsArray (headingsArray) {
      return reduce.call(headingsArray, function reducer (prev, curr) {
        var currentHeading = getHeadingObject(curr)
  
        addNode(currentHeading, prev.nest)
        return prev
      }, {
        nest: []
      })
    }
docs: Nest headings array into nested arrays with 'children' property.
  @param {Array} headingsArray
  @return {Object}