For example for the given jquery snippet, what should be the equivalent javascript. An equivalent add method in javascript can be helpful.
$("h1").add("span").add("h2");
As it clearly is mentioned in the jquery docs - .add() does not add any DOM element. https://api.jquery.com/add/ So using, .appendChild() does not serve the purpose here
appendChildmethod, please when asking a question first try to search for it's answer for little bit and than post it, beacuse this the answer for this is like on the first page of google..add()does is extend the contents of the jQuery object; it does not affect anything else. There really is no equivalent because of that. (Note also that jQuery is itself of course JavaScript code.)