Maybe thinking of this
const byte thePins[] = {5, 6, 7, 8, 9, 10,};
const byte nPins = sizeof thePins / sizeof *thePins;
// then later
for (byte ii = 0; ii < nPins; ii++) {
digitalWrite (thePins[ii], LOW);
}
// and so forth
I don't like using pin numbers in a way that makes code inflexible, or harder to flex.
a7