Check out example codes for "for javascipt". It will help you in understanding the concepts better.

Code Example 1

for (let i = 0; i < 9; i++) {
  str = str + i;
}

Code Example 2

const array = ['hello', 'world', 'of', 'Corona'];

for (const item of array) {
  console.log(item);
}

Code Example 3

//this loops through an array, 'cars', and logs each element to the console.
for (var i = 0; i < cars.length; i++) {
  //repeating code here:
  console.log(cars[i]);
}

Code Example 4

for (i = 0, len = cars.length, text = ""; i < len; i++) { 
  text += cars[i] + "<br>";

 }

Learn ReactJs, React Native from akashmittal.com