I wrote this script to get text, if it equals, append the name of the group to a person's information. I know using .each() is gpu intensive and this feels like a poor way of writing the code.var committee = $('.committee');var committeeName = $('.committee-name');var detailNames = $('.text_center');committee.each(function() {    var members = $(this).find('.com-member ul li');    members.each(function() {        member = $(this).text();        memberCommittee = $(this).closest(committee).find(committeeName).text();        detailNames.each(function() {            var detailName = $(this).text();            var detailCom = $(this).closest('.detail-info').find('.detail-comm');            if(member == detailName) {                detailCom.append(memberCommittee + , );            };        });    });});
Appending a group name to each committee member
javascript;jquery;dom