let's say I have an group contract where users can join and leave groups. When a user joins a group, his address will be added to members[groupId]. When he lefts, the members[groupId] will be set to 0x0. Let's say members[0] is 2,000 values long. The problem is, that not all of these 2,000 members are active/in the group as some addresses in that array are 0x0 addresses.
Let's say I have now a website where I want to get all active members of group 0. What are now the best ways to get the active users? A 2,000 times loop in javascript? Or are there maybe more efficient ways to solve it?