Check out example codes for "iterating over an array of images then inserting them into an html document". It will help you in understanding the concepts better.

Code Example 1

var elements = document.querySelectorAll("a");
for (var i= 0; i < elements.length; i++) {
    elements[i].style.color = "red";
}

Learn ReactJs, React Native from akashmittal.com