Let's say you are fetching the roster, then for each entity, you can check for the specific group, or "null" for contact who are not in any of the group.
var myentity = jabberwerx.RosterContact;
for(var i=0; i<jids.length; i++) {
myentity = jids[i];
if(myentity.getGroups() != "specific group name") {
rosterpresence = myentity.getPrimaryPresence();
}
}
or, myentity.getGroups() != "" for the group name that is empty.
Thanks,
Howard