Digital Reading from a array without using the exact element
In your question you wrote


  and turn [the LED] off when [the corresponding button is] released


and yet you never turn the LEDs off in your code. Then, I assume the
code in your question is irrelevant, and you just want the LEDs to show
the states of the buttons at all times. This can be done by writing to
the LEDs the values you read from the buttons. Do this for each
button/LED pair, and loop over the pairs:

void loop() {
    for (int i = 0; i &lt; 5; i++)
        digitalWrite(myLEDArray[i], digitalRead(myButtonArray[i]));
}