Multiple LED's using an Array

ledPins[5,6,7]

That syntax is invalid

It is not invalid. It compiles. It runs and does something. Just not what the OP wanted. As the OP discovered, only the final led number is actioned. The reason is that the comma is actually an "operator" in C/C++. The expression "a, b" means "evaluate a but discard the result, then evaluate b and use that result". It may seem a little stupid that the compiler would allow that, but remember that even though the result a is discard, evaluating could have some useful side-effect. For example if you said "a++, b" then b would be used, but a would still have been incremented: next time you use a, you would see that a was one more than last time you used it.

Having said all that, I am not suggesting that anyone actually uses this technique. It's confusing and does not make your code easy to read or understand!