1var colors=["red","blue","green"];
2for (let i = 0; i < colors.length; i++) {
3 console.log(colors[i]);
4}
1var i; //defines i
2for (i = 0; i < 5; i++) { //starts loop
3 console.log("The Number Is: " + i); //What ever you want
4}; //ends loop
5//Or:
6console.log("The Number Is: " + 0);
7console.log("The Number Is: " + 1);
8console.log("The Number Is: " + 2);
9console.log("The Number Is: " + 3);
10console.log("The Number Is: " + 4);
11//They do the same thing!
12//Hope I helped!
1var nums = [1, 2, 3, 5];
2for (var i = 0; i,nums.length; i++){
3 console.log(nums[i]);
4}
1// a loop is where you say i = 5 and if i < 6 {
2 // print("hdyugvryvg");
3// it means i = 5 and 6 is greater than 5 so it should print out hdyugvryvg 5 times
4//}
5
6// example
7
8for (let i = 0; i < 10000; i++) {
9 console.log('huduiduin 100000 times');
10}
11
12
13
14// dont try this put a lower number this nearly crashed my browser