I have a prototype viewer application in which there are a number of our map services added. In many of those map services, there are group layers (e.g., under Electric, we have Electric 12.5, Electric 34.5, etc.). What I can't figure out to do is to check for the visibility of those group layers. I can loop through the LayerCollection and check for DynamicMapServices or FeatureLayers but I can't find an object for group layers. I also know you can check the Rest endpoint to determine if a GroupLayer but not its visibility. Can someone tell me how to loop through what is in the table of contents and check for the visibility of group layers?