Iterating through an array of images

Hello everyone. I am trying to create a simple slideshow website. I managed to get the photo to change on the buttons click, however it will only change to the 2nd image. I know there is something wrong with my change function, but I am not skilled enough to see the solution.
I hope this won’t take too much of your time. Thank you.

const imageArray = ["", "", "", "", "", "" ]

const DisplayImage = document.getElementById('painting1')
const imageIndex = 0;

function changeImage() {
  DisplayImage.setAttribute("src", imageArray[imageIndex]);

Link to full project if needed

imageIndex is declare as const , it is immutable The value of a constant can’t be changed through reassignment, and it can’t be redeclared (mdn site)
errors message in chrome dev toolserrors

replace const by let

1 Like

Solved, thank you.
deep down I knew that, however I forgot here.