whole_func_string: function _insertBeforeFirst($container, selector, elem) {
      const foundElems = $container.find(selector);
      if (foundElems.length > 0) {
          foundElems.eq(0).before(elem);
      } else {
          $container.append(elem);
      }
  }
func_code_string: function _insertBeforeFirst($container, selector, elem) {
      const foundElems = $container.find(selector);
      if (foundElems.length > 0) {
          foundElems.eq(0).before(elem);
      } else {
          $container.append(elem);
      }
  }
func_documentation_string: Prepend the given element before the first existing element of same type.
  This is generally used for loading Docma assets first (such as docma-web.js
  and docma.css). Update: this is NOT used for scripts anymore, bec. jQuery
  2.x duplicates the scripts. For scripts, we use our
  `HtmlParser.DOM.insertBeforefirst()` method instead.
  @private
  
  @param {jQuery} $container - Container jQuery element.
  @param {String} selector - Target element type selector. e.g. `"script"`.
  @param {jQuery} elem - Element to be prepended.