And if you're talking Javascript, you have the LayerSet.visible for that. Just remember you have multiple ways of going through a document
- ArtLayer is the thing called "layer" in Photoshop, i.e. ~content
- LayerSet is a group in Photoshop
- Layer is either, you'll know by Layer.typename
- .artLayers and .layerSets are collections of just those and .layers is a collection of either.