ChoreDoor - using variable to loop through elements

If I am assigning elements to numbered variables, is it possible to then loop through those variables to set properties of the elements.

Specifically in the ChoreDoor practice:

const doorImage1 = document.getElementById("door1");
const doorImage2 = document.getElementById("door2");
const doorImage3 = document.getElementById("door3");
const closedDoorPath = "https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/closed_door.svg";

I want to assign all the elements the same .src path by way of a loop (I understand it isn’t necessary for such a small amount of elements, but what if there were say several dozen or more of them).

My method would be to use a loop to select the element and then reassign the .src property like so

for(let i = 1; i<=3; i++){
    let currentDoor = `doorImage${i}` +'.src';;
    currentDoor = closedDoorPath;
    }

when I log currentDoor to the console it shows doorImage1.src
and when I log closedDoorPath to the console it shows “https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/closed_door.svg

yet the element does not change to reflect the src indicated by closedDoorPath.

I’m guessing the template literal means I’m not actually grabbing the object just assigning a string to the currentDoor variable.

So how would I grab the element using such a method?

Hopefully this isn’t worded too confusingly.

Thanks!

https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/closed_door.svg