How can I refactor a long if-else statement checking array length?
问题 I am writing a program that uses checkboxes to filter a list of items. I have a group of 3 checkboxes: phase , specialty , and type . Once the checkboxes are marked, they are put into an array which is then used to filter out a list if the conditions match. When making this, I ran into a few issues: If no boxes were checked, then no list would appear at all. If a box in all categories were checked, then it would show both conditions rather than when both are true (so if I had phase Base 1 and