JSFiddle - React, Tailwind, and code Playground
HTML
<p>blah</p>
<p>blah</p>
<p>blah</p>
<p>blah</p>
<p>blah</p>
<p>blah</p>
JavaScript
group = $("p")
$.each(group, function(idx, val,f) {
alert(idx + ': ' + val);
if(idx == group.length - 1)
alert("done");
});