Yes, the first one will create a jQuery object containing the elements matched by both selectors. The second will create an object in which there are elements corresponding to the first selector, then create and return a new object with both, without changing the first object.
For instance:
var jq1 = $('h1, h2'); // Will contain all <h1> and <h2> elements. jq1.add('h3'); alert(jq1.filter('h3').length); // Will alert 0, because the // original object was not modified. jq1 = jq1.add('h3'); alert(jq1.filter('h3').length); // Will alert the number of <h3> elements.
source share