> which to this day [the append() and prepend() functions jQuery provides] have no direct competitor in vanilla js The vanilla JS append() and prepend() methods? I understand there are differences w/these vs jQuery but, for discussion, why not use those? https://developer.mozilla.org/en-US/docs/Web/API/Element/pre...
Mainly because the vanilla append/prepend functions require that you create an element first, then insert it at the desired position. The ease of use of jQuerys string to html node isnt matched by vanilla js in these functions. The closest you would get is this: https://developer.mozilla.org/en-US/docs/Web/API/Element/ins... But the jQuery prepend/append functions are still easier to read and shorter to write.
Interesting the article uses innerHtml in its helper function, jQuery's .html() method itself includes the comment "See if we can take a shortcut and just use innerHTML"
https://github.com/jquery/jquery/blob/4a13266efd262a92f05d86...