var decrementIndex = function(){
//console.log(currentIndex);
currentIndex = currentIndex - 1;
if (currentIndex < 0) {currentIndex = images.length - 1}
return currentIndex;
}
prev.onclick = function(){
img.setAttribute('src', images[*decrementIndex(currentIndex)*]);
}
----
Type your question above this line.
Course: https://www.educative.io/collection/10370001/5686791109607424
Lesson: https://www.educative.io/collection/page/10370001/5686791109607424/5759778777202688