not able to understand the use of the following elements in the given code
what is the use of:- var num=0 in first line of code, num++ in in 4th line, if(num>=images.length) { num=0 } in 5th and 6th line, slider.src[num] in 7th line, num-- in 10th line, if(num<0){ num=image.length-1 in 12th line GIVEN CODE :- var images = [ "http://www.sololearn.com/uploads/slider/1.jpg", "http://www.sololearn.com/uploads/slider/2.jpg", "http://www.sololearn.com/uploads/slider/3.jpg" ]; var num = 0; function next() { var slider = document.getElementById("slider"); num++; if(num >= images.length) { num = 0; } slider.src = images[num]; } function prev() { var slider = document.getElementById("slider"); num--; if(num < 0) { num = images.length-1; } slider.src = images[num]; } REQUEST:- please upvote this question